javaJDialog设置为模态后为什么对话框就变一点小了 告急!!!! 15
这是设置成模态后的图片下面是非模态不知道为什么大神们帮我看一下告急!!对话框源代码自定义的类在主类里直接调用的去掉了部分但不影响运行publicclassGamesetD...
这是设置成模态后的图片
下面是非模态 不知道为什么 大神们帮我看一下 告急!!
对话框源代码 自定义的类 在主类里直接调用的 去掉了部分 但不影响运行
public class GamesetDialog {
private JPanel panel;
private JLabel choosenandu,choosediscaccount,discsize,jmin,jmax;
private JButton disccolor,confirm;
private JRadioButton primary,middle,high;
private JTextField account,min,max;
private ButtonGroup buttongroup;
public GamesetDialog(JFrame container) {
JDialog jj= new JDialog(container,"游戏设置",true);
Container c=jj.getContentPane();
c.setLayout(null);
choosenandu = new JLabel("选择关卡");
choosenandu.setBounds(5,20,100,20);c.add(choosenandu);
buttongroup=new ButtonGroup();
primary= new JRadioButton("初级");middle= new JRadioButton("中级");high= new JRadioButton("高级");
primary.setBounds(5,60,60,20);
middle.setBounds(70,60,60,20);
high.setBounds(135,60,60,20);
c.add(primary);c.add(middle);c.add(high);
buttongroup.add(primary);buttongroup.add(middle);buttongroup.add(high);
choosediscaccount = new JLabel("盘子数量(1-15)");
choosediscaccount.setBounds(5,100,100,20);c.add(choosediscaccount);
account=new JTextField();
account.setBounds(115,100,100,20);c.add(account);
discsize = new JLabel("盘子大小");
discsize.setBounds(5,140,100,20);c.add(discsize);
jmax=new JLabel("最大");max=new JTextField();
jmax.setBounds(5,170,30,20);max.setBounds(40,170,100,20);
c.add(jmax);c.add(max);
jmin=new JLabel("最小");min= new JTextField();
jmin.setBounds(170,170,50,20);min.setBounds(205,170,100,20);
c.add(jmin);c.add(min);
jj.pack();
//jj.setResizable(false);jj.setVisible(true); jj.setBounds(100,100,400,340);jj.setDefaultCloseOp 展开
下面是非模态 不知道为什么 大神们帮我看一下 告急!!
对话框源代码 自定义的类 在主类里直接调用的 去掉了部分 但不影响运行
public class GamesetDialog {
private JPanel panel;
private JLabel choosenandu,choosediscaccount,discsize,jmin,jmax;
private JButton disccolor,confirm;
private JRadioButton primary,middle,high;
private JTextField account,min,max;
private ButtonGroup buttongroup;
public GamesetDialog(JFrame container) {
JDialog jj= new JDialog(container,"游戏设置",true);
Container c=jj.getContentPane();
c.setLayout(null);
choosenandu = new JLabel("选择关卡");
choosenandu.setBounds(5,20,100,20);c.add(choosenandu);
buttongroup=new ButtonGroup();
primary= new JRadioButton("初级");middle= new JRadioButton("中级");high= new JRadioButton("高级");
primary.setBounds(5,60,60,20);
middle.setBounds(70,60,60,20);
high.setBounds(135,60,60,20);
c.add(primary);c.add(middle);c.add(high);
buttongroup.add(primary);buttongroup.add(middle);buttongroup.add(high);
choosediscaccount = new JLabel("盘子数量(1-15)");
choosediscaccount.setBounds(5,100,100,20);c.add(choosediscaccount);
account=new JTextField();
account.setBounds(115,100,100,20);c.add(account);
discsize = new JLabel("盘子大小");
discsize.setBounds(5,140,100,20);c.add(discsize);
jmax=new JLabel("最大");max=new JTextField();
jmax.setBounds(5,170,30,20);max.setBounds(40,170,100,20);
c.add(jmax);c.add(max);
jmin=new JLabel("最小");min= new JTextField();
jmin.setBounds(170,170,50,20);min.setBounds(205,170,100,20);
c.add(jmin);c.add(min);
jj.pack();
//jj.setResizable(false);jj.setVisible(true); jj.setBounds(100,100,400,340);jj.setDefaultCloseOp 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询