小编ram*_*mya的帖子

Seaglass的外观和感觉

我写了一个简单的测试类来测试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)

java swing look-and-feel nimbus

3
推荐指数
1
解决办法
7404
查看次数

如何在swing java中使用布局管理器

我是布局经理的新手,比如Flow,borders......
我主要setBounds()用来设置我的组件的位置.

我读了一篇文章,使用setBounds不是一个很好的做法,这是更好地使用一些布局.

哪些是最好和最常用的布局?
如何使用布局管理器定位按钮 ; 而不是做setbounds(10,10,100,30)

java layout swing

3
推荐指数
1
解决办法
4937
查看次数

我可以在java中的endswith方法中使用通配符查询吗

我需要把所有与文件结束.doc,我有像一些自定义扩展.doc.25-40.doc2etc..i需要得到所有的扩展.doc.*

filename.endsWith(".doc.*"); 
Run Code Online (Sandbox Code Playgroud)

为什么失败?

java

1
推荐指数
1
解决办法
2162
查看次数

标签 统计

java ×3

swing ×2

layout ×1

look-and-feel ×1

nimbus ×1