怎样把窗口的lookandfeel设置成Metal样式? String laf = "javax.swing.plaf.metal.MetalLookAndFeel";try { UIManager.setLookAndFeel(laf);} catch (Exception e) { } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 插入到程序界面载入前比如 main() 方法里最前面 import javax.swing.*;import java.awt.*;public class JFrameTest extends JFrame{ public JFrameTest (){ super("这是一个测试程序!"); setBounds(200,200,200,200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); show(); } public static void main(String args[]){ try{ /*设置LookAndFeel*/ UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); /*也可以设置为下列的LookAndFeel*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } catch(ClassNotFoundException e){ e.printStackTrace(); } catch(InstantiationException e){ e.printStackTrace(); } catch(IllegalAccessException e){ e.printStackTrace(); } catch(UnsupportedLookAndFeelException e){ e.printStackTrace(); } JFrameTest test=new JFrameTest(); }} 聊聊接口(interface)和抽象类(abstract) 做通讯软件待遇怎么样啊 求 一 提取ORCALE数据库 一个表中规定数量的记录的SQL 语句写法 请不吝赐教 求用户注册登陆图片验证码的实现 关于request.getParameter的问题 帮忙提供一加密算法 问一个基本的问题? 关于文件存储的更改与删除,急!!! showInputDialog()输入对话框如何实现密码输入的功能? 请教:Applet引用了Swing,为何在IE中没法运行啊? smtp协议发送电子邮件出错 在jb9下编译"默认封装"的问题.???值得研究
import java.awt.*;
public class JFrameTest extends JFrame{ public JFrameTest (){
super("这是一个测试程序!");
setBounds(200,200,200,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
show();
}
public static void main(String args[]){
try{
/*设置LookAndFeel*/
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
/*也可以设置为下列的LookAndFeel*/
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
}
catch(ClassNotFoundException e){
e.printStackTrace();
}
catch(InstantiationException e){
e.printStackTrace();
}
catch(IllegalAccessException e){
e.printStackTrace();
}
catch(UnsupportedLookAndFeelException e){
e.printStackTrace();
}
JFrameTest test=new JFrameTest();
}
}