Without using the Swing GUI on Eclipse, I tried to add a button in the JFrame anywhere in the frame (so there is no BorderLayout.CENTER ). I can not pass by:
JPanel panel = new JPanel(); JButton OKButton = new JButton("OK"); OKButton.addActionListener(new MyAction()); panel.add(OKButton,BorderLayout.CENTER);
So will something like this be completely redesigned or is there something I am missing?
EDIT: Anywhere (since I plan to add a few frames / labels to the frame), I meant, possibly, the coordinate in the frame. So, except for the dead center, (for example) 75% on the left and 25% down.
Hairr source share