In design mode:
select your JFrame(on Design mode), and then go to Properties, Bindings,Events, Code.
We need "Code" and set properties Generate Center (true) that's all.
--
select your JFrame(on Design mode), and then go to Properties, Bindings,Events, Code.
We need "Code" and set properties Generate Center (true) that's all.
--
Another way through code:
JFrame frame = new JFrame("FooRendererTest");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(mainPanel); // or whatever...
frame.pack();
frame.setLocationRelativeTo(null); // *** this will center your app ***
frame.setVisible(true);
No comments:
Post a Comment