问题描述
如何在JInternalFrame最大化时将他的标题栏去掉可发到我的邮箱:smkfifkfv0305@126.comimportjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjava.sql.*;importjava.lang.*;publicclassWaterMangerextendsJFrame{JDesktopPanedeskpane=newJDesktopPane();//在窗体里建立虚拟桌面并实例化//JPanelp=newJPanel();//创建一个面板并实例化ImageIconicon=newImageIcon("image//1.gif");intw,h;publicWaterManger(){super("智能水控管理系统");Containercon=getContentPane();JMenuBarmb=newJMenuBar();JMenusystemm=newJMenu("系统管理");JMenuItemyh=newJMenuItem("增加用户");systemm.add(yh);yh.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){deskpane.add(newTYH());}});/**exit.addActionListener(newActionListener(){//退出系统监听publicvoid*actionPerformed(ActionEvente){//new*JOptionPane().showMessageDialog(setVisible(false);}});*/mb.add(systemm);setJMenuBar(mb);Imageimg=Toolkit.getDefaultToolkit().getImage("image\1.jpg");setIconImage(img);con.add(deskpane,BorderLayout.CENTER);//Toolkitt=Toolkit.getDefaultToolkit();Toolkitt=Toolkit.getDefaultToolkit();intw=t.getScreenSize().width;inth=t.getScreenSize().height;setBounds(w/4,h/4,w/2,h/2);setResizable(true);setVisible(true);}publicstaticvoidmain(String[]args){//主函数newWaterManger();}}importjava.awt.*;importjava.lang.*;importjavax.swing.*;importjava.awt.event.*;//publicclassTYHextendsJInternalFrameimplementsActionListener{JButtonbtn=newJButton("确定");JButtonbtn1=newJButton("取消");JPanelp=newJPanel();JLabell1=newJLabel("用户名:");JTextFieldtf=newJTextField();JLabell2=newJLabel("密码:");publicTYH(){super("",true,true,true,true);btn.addActionListener(this);btn1.addActionListener(this);p.setLayout(null);p.add(l1);l1.setBounds(10,20,60,25);p.add(l2);l2.setBounds(100,20,40,25);p.add(btn);btn.setBounds(30,60,60,25);p.add(btn1);btn1.setBounds(100,60,60,25);add(p,BorderLayout.CENTER);//setLocation(0,0);setSize(200,120);setResizable(true);setVisible(true);}publicvoidactionPerformed(ActionEvente){if(e.getSource()==btn){this.dispose();}}/*publicstaticvoidmain(String[]args){newTYH();}*/}
解决方案
解决方案二:
该回复于2009-07-21 10:15:48被版主删除