【初心者】Java質問・相談スレッド93【大歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0881デフォルトの名無しさん
2006/11/18(土) 20:49:09多分隠れてしまっていると思うのですがどうすれば線が見えるようになるの?
import javax.swing.*;
import java.awt.*;
public class nishi extends JFrame{
private static JFrame frame;
private JPanel p1,p2;
JButton btn3;
public void paintComponent(Graphics g){
super.paintComponents(g);
g.drawLine(300,300,300,709);
}
public nishi() {
p1 = new JPanel();
p1.setBounds(0,0,800,800);
p1.setLayout(null);
btn3 = new JButton();
btn3.setBounds(440,20,100,40);
p1.add(btn3);
Container cnt = getContentPane();
cnt.add(p1);
btn3.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event){
si_ue=true;
repaint();
}
});
■ このスレッドは過去ログ倉庫に格納されています