September 09, 2010, 01:42:30 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Add scroll bars to JTextArea using JScrollPane  (Read 1048 times)
0 Members and 1 Guest are viewing this topic.
G. Ritardo
Member
*
*

Reputation: 0
Offline Offline
Posts: 53
Referrals: 0

Awards
« on: May 21, 2009, 08:12:50 AM »

Code
GeSHi (java):
  1. import javax.swing.JFrame;
  2. import javax.swing.JScrollPane;
  3. import javax.swing.JTextArea;
  4.  
  5. public class ScrollingTextArea extends JFrame {
  6.  
  7. JTextArea txt = new JTextArea();
  8. JScrollPane scrolltxt = new JScrollPane(txt);
  9.  
  10. public ScrollingTextArea() {
  11.  
  12. setLayout(null);
  13.  
  14. scrolltxt.setBounds(3, 3, 300, 200);
  15. add(scrolltxt);
  16. }
  17.  
  18.  
  19. public static void main(String[] args) {
  20.  
  21. ScrollingTextArea sta = new ScrollingTextArea();
  22. sta.setSize(313,233);
  23. sta.setTitle("Scrolling JTextArea with JScrollPane");
  24. sta.show();
  25. }
  26.  
  27. }
Created by GeSHI 1.0.7.20


Logged
My Contributions

Onzin > Email address of gaylords


Founder of www.Retardation-Foundation.com :: A community for retarded people!? Powered by admin Gaylord Ritardo.
Javaforums.net :: a community about Java software development.
« on: May 21, 2009, 08:12:50 AM »

Your Ad Here
 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.226 seconds with 33 queries.

Google visited last this page Yesterday at 02:00:55 AM