我在ECLIPSE官方下了ECLIPSE3.1及其插件VE.EMF.GEF安装后,在FRMAE里拖入了一个控件JBUTTON拖入时感觉很是好看,就像是联众里的启动画面似的.可是我运行代码后(代码是软件自动生成的本人没有动过),界面上的两个BUTTON变的很是难看.请问这ECLIPSE就这样还是我那个地方有错误?

解决方案 »

  1.   

    可能是java默认的feelandlook吧在main里加下面的试试
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) { }
      

  2.   

    兄弟,加不上,提提示错误:
    UIManager cannot be resolved
    代码我贴出来:
    package cs;import java.awt.Frame;
    import javax.swing.JButton;public class aa extends Frame {
    public static void main(String[] args){
    try {
    UIManager.setLookAndFeel(UIManager.
    getSystemLookAndFeelClassName());
    } catch (Exception e) {
    }
    }
    private JButton jButton = null;
    /**
     * This is the default constructor
     */
    public aa() {
    super();
    initialize();
    } /**
     * This method initializes this
     * 
     * @return void
     */
    private void initialize() {
    this.setLayout(null);
    this.setSize(87, 95);
    this.setBackground(java.awt.Color.pink);
    this.setTitle("Frame");
    this.add(getJButton(), null);
    } /**
     * This method initializes jButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton() {
    if (jButton == null) {
    jButton = new JButton();
    jButton.setComponentOrientation(java.awt.ComponentOrientation.UNKNOWN);
    jButton.setBounds(new java.awt.Rectangle(26,33,73,53));
    jButton.setText("确定");
    }
    return jButton;
    }}  //  @jve:decl-index=0:visual-constraint="9,6"