alguem pode me dizer pq os botoes do applet n aparecem, so depois deu passar o mouse sobre eles?
import java.awt.*;
import javax.swing.event.*;
import javax.swing.*;
public class InterfaceDisplay extends JApplet {
Container c;
GridBagConstraints cons;
JButton jb_play, jb_stop, jb_pause;
public void init(){
jb_play = new JButton(">");
jb_stop = new JButton("||");
jb_pause = new JButton("[]");
c = getContentPane();
cons = new GridBagConstraints();
GridBagLayout gb = new GridBagLayout();
c.setLayout(gb);
}
public void start(){
JPanel jp_botoes = new JPanel();
layout(0, 0, 1, 1, 3, 3, 3, 3, jp_botoes, jb_play);
layout(0, 1, 1, 1, 3, 3, 3, 3, jp_botoes, jb_stop);
layout(0, 2, 1, 1, 3, 3, 3, 3, jp_botoes, jb_pause);
c.add(jp_botoes, cons);
repaint();
}
public void paint(Graphics g){
//for(int counter = 1; counter <= 10; counter++)
//g.drawLine(10, 10, 250, counter * 10);
}
public void layout(int x, int y, int celx, int cely, int cima, int baixo, int dir, int esq, JPanel panel, JComponent comp){
cons.gridx = x;
cons.gridy = y;
cons.gridwidth = celx;
cons.gridheight = cely;
cons.insets = new Insets(cima, esq, baixo, dir);
panel.add(comp, cons);
}
}