Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #227
| From | "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: problem with setting |
| Message-ID | <456c676a$1@dnews.tpgi.com.au> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <1164729419.208051.309040@h54g2000cwb.googlegroups.com> |
| Date | 2011-04-27 15:26 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui
"Adam Sandler" <corn29@excite.com> wrote in message
news:1164729419.208051.309040@h54g2000cwb.googlegroups.com...
> Hello,
<snipped>
try this
import java.awt.*;
import javax.swing.*;
class MyFrame extends JFrame
{
private static final long serialVersionUID = 1L;
public void showFrame()
{
setTitle( "Please Wait..." );
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new GridBagLayout());
JPanel centerPanel = new JPanel();
centerPanel.setBorder(BorderFactory.createLoweredBevelBorder());
//centerPanel.setPreferredSize(new Dimension(50, 25));
centerPanel.setPreferredSize(new Dimension(50, 25));
//Dimension screenDim =
//Toolkit.getDefaultToolkit().getScreenSize();
//Rectangle winRect = getBounds();
//setLocation((screenDim.width - winRect.width) /
//2,(screenDim.height - winRect.height) / 2);
//getContentPane().add(centerPanel);
getContentPane().add(centerPanel,new GridBagConstraints());
setSize(225, 100);
setLocationRelativeTo(null);//<-----
setVisible(true);
}
public static void main(String[] args){new MyFrame().showFrame();}
}
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
problem with setting a pa "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Fred Kleinschmidt" <fred.kleinschmidt@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
csiph-web