我写了一个简单的测试类来测试seaglass外观和感觉的功能http://seaglass.googlecode.com/ 我得到了'nimbus class not found'的例外.
import java.awt.*;
import javax.swing.*;
public class asd {
private static void createWindow() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
//Create and set up the window.
JFrame frame = new JFrame("Simple GUI");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel textLabel = new JLabel("I'm a label in the window",SwingConstants.CENTER);
textLabel.setPreferredSize(new Dimension(300, 100));
frame.getContentPane().add(textLabel, BorderLayout.CENTER);
//Display the window.
frame.setLocationRelativeTo(null);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
createWindow();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace(); …Run Code Online (Sandbox Code Playgroud) 我是布局经理的新手,比如Flow,borders......
我主要setBounds()用来设置我的组件的位置.
我读了一篇文章,使用setBounds是不是一个很好的做法,这是更好地使用一些布局.
哪些是最好和最常用的布局?
如何使用布局管理器定位按钮 ; 而不是做setbounds(10,10,100,30)?
我需要把所有与文件结束.doc,我有像一些自定义扩展.doc.25-40,
.doc2etc..i需要得到所有的扩展.doc.*
filename.endsWith(".doc.*");
Run Code Online (Sandbox Code Playgroud)
为什么失败?