提问啊! 关于dialog画面! dialog 里不可以加放大缩小按纽。想把JFrame作成模态的话,去看Dialo的原代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 做个类似与JDialog的东东,private class TableName extends JDialog { public TableName(JFrame f){ super(f, "插入报表标题", true); setBounds(300,300,250,250); JPanel JPc = new JPanel(); JPc.setLayout(new GridLayout(6,2,2,2)); JLabel Lname = new JLabel("表 名 称 : "); JLabel lheadbg = new JLabel("背 景 色 : "); JLabel lheadfont = new JLabel("字 体 : "); JLabel lheadfontcolor = new JLabel("字 体 颜 色 : "); JLabel lheadFontsize = new JLabel("字 体 大 小 : "); Lresult = new JLabel(""); String[] ComboStr1 = {"宋体","黑体","隶书"}; String[] ComboStr3 = {"白色","红色","兰色","绿色","黑色","黄色","紫色","橙色"}; String[] ComboStr4 = {"黑色","红色","兰色","绿色","白色","黄色","紫色","橙色"}; jheadbgcolor = new JComboBox(ComboStr3); jheadbgcolor.setActionCommand("headbgcolor"); jheadbgcolor.addActionListener(new ActionSet("headbgcolor",null)); jheadfont = new JComboBox(ComboStr1); jheadfont.setActionCommand("jheadfont"); jheadfont.addActionListener(new ActionSet("jheadfont",null)); jheadfontcolor = new JComboBox(ComboStr4); jheadfontcolor.setActionCommand("headfontcolor"); jheadfontcolor.addActionListener(new ActionSet("headfontcolor",null)); String[] ComboStr2 = {"13","12","14","16","18","20","24","26","30","36","48","72"}; jheadfontsize = new JComboBox(ComboStr2); jheadfontsize.setActionCommand("jheadfontsize"); jheadfontsize.addActionListener(new ActionSet("jheadfontsize",null)); TFname = new JTextField(); if(bisOpen){ TFname.setText(ar.getHeadText(1)); } jheadbutton = new JButton("生成标题"); jheadbutton.setActionCommand("生成标题"); jheadbutton.addActionListener(new ActionSet("生成标题",null)); JPc.add(Lname).setFont(font); JPc.add(TFname).setFont(font); JPc.add(lheadbg).setFont(font); JPc.add(jheadbgcolor).setFont(font); JPc.add(lheadfont).setFont(font); JPc.add(jheadfont).setFont(font); JPc.add(lheadfontcolor).setFont(font); JPc.add(jheadfontcolor).setFont(font); JPc.add(lheadFontsize).setFont(font); JPc.add(jheadfontsize).setFont(font); JPc.add(jheadbutton).setFont(font); JPc.add(Lresult).setFont(font); getContentPane().add(JPc); show(); } } 你这是想把dialog和frame的功能合起来嘛!~应该可以,但不太容易。毕竟各自的属性不同,用处也不同。 jsp在查询的时候报错了 SocketChannel 如何做到按“ESC”键就关闭面板 数字格式化的问题.0的时候如何不显示? 急!简单问题!在这里等回复 求教阳历转阴历的JAVA算法!! #####超强的资料管理、报刊下载软件,大家有兴趣下载用用########## 象sinaticker和msnbc news alert这类软件是怎么做的,思路是什么,信息是如何传递的,要实现那些细节,大家给点意见吧! 调查!!!在公司里JAVA到底用来做什么项目???薪水何? 点对点通信图形化用户聊天系统《新手求助》 ★★★算法问题★★★ 关于大对象的存取
private class TableName extends JDialog {
public TableName(JFrame f){
super(f, "插入报表标题", true);
setBounds(300,300,250,250); JPanel JPc = new JPanel();
JPc.setLayout(new GridLayout(6,2,2,2));
JLabel Lname = new JLabel("表 名 称 : ");
JLabel lheadbg = new JLabel("背 景 色 : ");
JLabel lheadfont = new JLabel("字 体 : ");
JLabel lheadfontcolor = new JLabel("字 体 颜 色 : ");
JLabel lheadFontsize = new JLabel("字 体 大 小 : ");
Lresult = new JLabel("");
String[] ComboStr1 = {"宋体","黑体","隶书"};
String[] ComboStr3 = {"白色","红色","兰色","绿色","黑色","黄色","紫色","橙色"};
String[] ComboStr4 = {"黑色","红色","兰色","绿色","白色","黄色","紫色","橙色"};
jheadbgcolor = new JComboBox(ComboStr3);
jheadbgcolor.setActionCommand("headbgcolor");
jheadbgcolor.addActionListener(new ActionSet("headbgcolor",null)); jheadfont = new JComboBox(ComboStr1);
jheadfont.setActionCommand("jheadfont");
jheadfont.addActionListener(new ActionSet("jheadfont",null));
jheadfontcolor = new JComboBox(ComboStr4);
jheadfontcolor.setActionCommand("headfontcolor");
jheadfontcolor.addActionListener(new ActionSet("headfontcolor",null));
String[] ComboStr2 = {"13","12","14","16","18","20","24","26","30","36","48","72"};
jheadfontsize = new JComboBox(ComboStr2);
jheadfontsize.setActionCommand("jheadfontsize");
jheadfontsize.addActionListener(new ActionSet("jheadfontsize",null));
TFname = new JTextField();
if(bisOpen){
TFname.setText(ar.getHeadText(1));
}
jheadbutton = new JButton("生成标题");
jheadbutton.setActionCommand("生成标题");
jheadbutton.addActionListener(new ActionSet("生成标题",null));
JPc.add(Lname).setFont(font);
JPc.add(TFname).setFont(font);
JPc.add(lheadbg).setFont(font);
JPc.add(jheadbgcolor).setFont(font);
JPc.add(lheadfont).setFont(font);
JPc.add(jheadfont).setFont(font);
JPc.add(lheadfontcolor).setFont(font);
JPc.add(jheadfontcolor).setFont(font);
JPc.add(lheadFontsize).setFont(font);
JPc.add(jheadfontsize).setFont(font);
JPc.add(jheadbutton).setFont(font);
JPc.add(Lresult).setFont(font);
getContentPane().add(JPc);
show(); } }