I Have a JPanel and a Applet inside a JFrame, and im tryng to align them like this:
Im almost loosing my hair on this as it seems so hard to align...
This is my actual snippet:
The JFrame is opening very small with only the button on it.
final JFrame f = new JFrame();
JPanel appletPanel = new JPanel();
appletPanel.setBackground(Color.RED);
JPanel menuPanel = new JPanel();
menuPanel.setBackground(Color.BLUE);
f.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
// f.setExtendedState(JFrame.MAXIMIZED_BOTH);
// f.setResizable(false);
int w = Toolkit.getDefaultToolkit().getScreenSize().width;
int h = Toolkit.getDefaultToolkit().getScreenSize().height;
f.setSize(Toolkit.getDefaultToolkit().getScreenSize());
VNCApplet applet = new VNCApplet();
menuPanel.add(new JButton("TEST"));
appletPanel.setSize((int)(w*0.7),h);
menuPanel.setSize((int)(w*0.3),h);
c.gridx = 0;
c.gridy = 0;
f.getContentPane().add(appletPanel,c);
c.gridx = 0;
c.gridy = 1;
f.getContentPane().add(menuPanel,c);
f.pack();
applet.init();
applet.start();
f.setVisible(true);
Thanks alot for the attention !