I've been searching in google how to build something that looks like in the image. Text boxes, labels, buttons with actions and a graphic area all in one JFrame, but I only can find them separated. I mean, I understand how to build them separated but no how to put them together. I've been reading about using GridBagConstraints but is very confusing. I would appreciate any tip.
The easiest way is to use the BorderLayout and include your panels ("separated components") at the regions (north, south, east, west, or center) you want.
JFrame frame = new JFrame();
JPanel actions = new JPanel();
JPanel graph = new JPanel();
frame.setLayout(new BorderLayout());
frame.getContentPane().add(actions, BorderLayout.SOUTH);
frame.getContentPane().add(graph, BorderLayout.CENTER);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.