我在选择时有三个单选按钮(rd_7inch、rd_9inch 和 rd_10inch)我正在更改文本框的大小
设置大小()
public void setsize()
{
if(rd_7inch.isSelected())
{ jScrollPane2.setSize(300, 300);
txt_sysnp.setSize(220,250);
System.out.println("******** 7inch : "+rd_7inch.isSelected());
}else if(rd_9inch.isSelected())
{ jScrollPane2.setSize(300, 350);
txt_sysnp.setSize(300,350);
System.out.println("******** 9inch : "+rd_9inch.isSelected());
}else
{ jScrollPane2.setSize(400,400);
txt_sysnp.setSize(400,400);
System.out.println("******** 10inch : "+rd_10inch.isSelected());
}
}
private void Cmb_CategoryActionPerformed(java.awt.event.ActionEvent evt) {
try {
String catname = Cmb_Category.getSelectedItem().toString();
int catindex = Cmb_Category.getSelectedIndex();
System.out.println(catname);
System.out.println(catindex);
String catpos = Category_list_pages.get(catindex);
System.out.println(catpos);
int catpages = Integer.parseInt(catpos);
for (int i = 1; i <= catpages; i++) {
Cmb_pageno.addItem("page" + i);
}
} catch (Exception e) {
}
setsize();
}
我有1 个 Jcombo 框和2 个按钮单击两个组件的 Jtext 区域大小变化,这对于特定的结果应该是恒定的。