painting the program
hey
When I run my program and I change the format of the screen, the program does nog repaint itself (you only see the two buttons, but not the text), but you have to hide it and then maximise it again first. Does anybody understand what I mean (I'm not great in English) and know what I've done wrong?
( the applic file)
publicclass DeclinatioApplicextends JFrame
{
DeclinatioApplic()
{this.setSize(800,600);
this.setTitle("DECLINATIO");
this.getContentPane().add(new DeclinatioApplet("Cambreur
College"));
}
publicstaticvoid main(String[] args)
{new DeclinatioApplic().setVisible(true);
}
}
(the applet file)
publicclass DeclinatioAppletextends JAppletimplements ActionListener, MouseListener
{
Button ok, info;
String eigenaar;
public DeclinatioApplet(String naamEigenaar)
{
eigenaar = naamEigenaar;
this.setBackground(Color.LIGHT_GRAY);
Container c = this.getContentPane();
c.setLayout(null);
ok =new Button("OK");
info =new Button("INFO");
ok.addActionListener(this);
info.addActionListener(this);
ok.setBackground(new Color(222,222,222));
info.setBackground(new Color(222,222,222));
ok.setBounds(300, 480, 50, 30);
info.setBounds(455, 480, 50, 30);
c.add(ok);
c.add(info);
c.addMouseListener(this)
}
publicvoid paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
Font titel =new Font("Arial", Font.BOLD, 40);
g2.setFont(titel);
g2.setColor(Color.GREEN.darker().darker());
g2.drawString("DECLINATIO", 280 , 80);
}
( and so on....)

