2016-06-29 39 views
0

當將許多文本行輸入到jTextArea時,在某些時候橫條向下滾動。 (即使沒有那個酒吧,我可以向上/向下滾動,但沒有它,它看起來很討厭)當jTextArea變得太大時,jScrollPane中的橫條消失

這就是它如何看起來與酒吧(在右側)。

而後來,由於更多的線,酒吧變得非常小,它添加更多的行時消失在某些點。

我該如何解決這個問題?

回答

1

,我發現這是改變你的Look and Feel 標準應該是這樣的最好的解決辦法:

public static void main(String args[]) { 
try { 
      for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 

       if ("Nimbus".equals(info.getName())) { 
        javax.swing.UIManager.setLookAndFeel(info.getClassName()); 
        break; 
       } 
      } 

     } catch (ClassNotFoundException ex) { 
      java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 
     } catch (InstantiationException ex) { 
      java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 
     } catch (IllegalAccessException ex) { 
      java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 
     } catch (javax.swing.UnsupportedLookAndFeelException ex) { 
      java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 
     } 
     //</editor-fold> 

     /* Create and display the form */ 
     java.awt.EventQueue.invokeLater(new Runnable() { 
      public void run() { 
       new MainFrame().setVisible(true); 
      } 
     }); 


} 

通過改變雨雲其他主題,您也將改變滑塊之一。

+0

好的,這不正是我所期待的,但是這個伎倆。也很高興知道你可以改變佈局 –