我做的java application很丑 听说可以用swing的外观插件改变外观 好象是说JFC什么的 我没什么
概念 谁能跟我具体讲讲啊。还有 哪有好的外观插件下载? 下载后具体怎么操作?我用的是eclipse
的IDE。 问题又大又菜 还请多多指教 谢谢拉
概念 谁能跟我具体讲讲啊。还有 哪有好的外观插件下载? 下载后具体怎么操作?我用的是eclipse
的IDE。 问题又大又菜 还请多多指教 谢谢拉
解决方案 »
- 程序错误
- JAVA 文件保存不全
- 马士兵视频的一个数三退一程序问题
- swing遇到了个麻烦
- ArrayList<E> 后面的 E 是什么意思?
- 请路过的高手指点
- 不懂;以每两个字节为单位对字符串进行处理。这两个字节直接转化为数字就是&#xxxxx;中的xxxxx,如果这个数字小于128就直接使用这个字符(
- java调用win32api??????????????
- 救命呀!
- 请教高手:我编的Applet插件只显示一个灰影,在JAVA控制台显示:awt.graphics2d.class没找到 请问应如何解决??
- 什么是hashcode?
- Math.ceil,Math.round,Math.floor 都分别代表什么意思?
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException cnfe)
{
System.err.println("initLookAndFeel(): " + cnfe); }
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException cnfe)
{
System.err.println("initLookAndFeel(): " + cnfe);
}
}
老大,用这个吧,我也是新学,这个不错
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.*;import javax.swing.*; import ccpsic.pre_test7;public class TestSQL{
public static void main(String argv[])
{
final JFrame frame = new JFrame( "只能运行一个 ");
try { UIManager
.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");// Nimbus风格,新出来的外观,jdk6
} catch (Exception e) {
e.printStackTrace();
}
frame.setBounds(100,100,200,200);
JButton jb1=new JButton("当前系统风格");
jb1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
frame.dispose();
frame.setBounds(200,200,300,300);
//frame.setVisible(true);
try {
UIManager
.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());// 当前系统风格
//frame.dispose();
frame.repaint();
frame.setVisible(true);
} catch (Exception e_myUIManager) {
e_myUIManager.printStackTrace();
}
}
});
JButton jb2=new JButton("Motif风格");
jb2.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
frame.dispose();
frame.setBounds(200,200,300,300);
//frame.setVisible(true);
try {
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");// Motif风格,外观接近windows经典,但宽宽大大,而且不是黑灰主色,而是蓝黑
//frame.dispose();
frame.repaint();
frame.setVisible(true);
} catch (Exception e_myUIManager) {
e_myUIManager.printStackTrace();
}
}
});
JButton jb3=new JButton("windows风格");
jb3.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
frame.dispose();
frame.setBounds(200,200,300,300);
//frame.setVisible(true);
try {
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");// windows风格
// update10版本以后的才会出现
//frame.dispose();
frame.repaint();
frame.setVisible(true);
} catch (Exception e_myUIManager) {
e_myUIManager.printStackTrace();
}
}
});
JButton jb4=new JButton("java风格");
jb4.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
frame.dispose();
frame.setBounds(200,200,300,300);
//frame.setVisible(true);
try {
UIManager
.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");// java风格
// update10版本以后的才会出现
//frame.dispose();
frame.repaint();
frame.setVisible(true);
} catch (Exception e_myUIManager) {
e_myUIManager.printStackTrace();
}
}
});
JPanel panel1=new JPanel();
panel1.add(jb1);
panel1.add(jb2);
panel1.add(jb3);
panel1.add(jb4);
frame.add(panel1);
frame.setVisible(true);
}
}