JFrame mf=new JFrame();
mf.setVisible(true);
mf.setTitle("enter sth");
mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mf.setSize(400, 300);
Container ct= mf.getContentPane();
ct.setLayout(new GridLayout(4,4));
//ct.add(new JButton("hello"));
String s= "987/654*321-0=C+";
for(int i=0;i<s.length();i++)
{
JButton jb=new JButton(Character.toString(s.charAt(i)));
ct.add(jb);
jb.setVisible(true);
}
mf.setVisible(true);
mf.setTitle("enter sth");
mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mf.setSize(400, 300);
Container ct= mf.getContentPane();
ct.setLayout(new GridLayout(4,4));
//ct.add(new JButton("hello"));
String s= "987/654*321-0=C+";
for(int i=0;i<s.length();i++)
{
JButton jb=new JButton(Character.toString(s.charAt(i)));
ct.add(jb);
jb.setVisible(true);
}
楼主【hbgzg3006】截止到2008-07-02 15:01:00的历史汇总数据(不包括此帖):
发帖的总数量:1 发帖的总分数:0
结贴的总数量:1 结贴的总分数:0
无满意结贴数:1 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:---------------------
无满意结贴率:100.00% 无满意结分率:---------------------
敬礼!
JFrame mf = new JFrame();
mf.setTitle("enter sth");
mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mf.setSize(400, 300);
Container ct = mf.getContentPane();
ct.setLayout(new GridLayout(4, 4));
// ct.add(new JButton("hello"));
String s = "987/654*321-0=C+";
for(int i = 0; i < s.length(); i++)
{
JButton jb = new JButton(Character.toString(s.charAt(i)));
ct.add(jb);
// 下面这行完全没作用,注掉
// jb.setVisible(true);
}
//调整一下顺序,把这行放到最后
mf.setVisible(true);
mf.validate();
不至于呀,我这里1.5的正常
用JBuilder搞的吧,hoho~~~~~~~~~~~~~该换了