I am creating a simple Java GUI with Swing and I have a white bar that appears under the title bar that I can't seem to figure out how to get rid of. I appreciate any help and tips as I have searched all over for anyone with a similar problem and have not been able to find anything. Thanks
Image of Java GUI:
import javax.swing.*;
import java.awt.*;
public class ja {
public static void main(String[] args) {
JFrame f = new JFrame("jA");
JPanel p = new JPanel();
p.setLayout(new FlowLayout());
f.setSize(400, 600);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel bg = new JLabel(new ImageIcon("brown.jpg"));
bg.setLayout(new FlowLayout());
p.add(bg);
JButton b1 = new JButton("b1");
JButton b2 = new JButton("b2");
JButton b3 = new JButton("b3");
bg.add(b1);
bg.add(b2);
bg.add(b3);
f.add(p);
f.setVisible(true);
}
}
Aucun commentaire:
Enregistrer un commentaire