• Post Reply Bookmark Topic Watch Topic
  • New Topic

rsyntaxtextarea - little help

 
Mathew Mintalm
Ranch Hand
Posts: 103
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone.

Currenlty I'm http://fifesoft.com/rsyntaxtextarea/ usser (this is new highlighting library)

Ok, so I have little problem.. I made my own problem in swing etc.

Ok in example i had something like:


JPanel contentPane = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
contentPane.add(new RTextScrollPane(textArea));
setContentPane(contentPane);


and than i have this TextPane on FULL SCREEN .. and now i dont know how can i add it ONLY into my JPANE.. i have Jpande called jpane1, and i did something like:

jpane1.add(textArea);

but it doesnt work, anyone can help me?
 
Rob Spoor
Sheriff
Posts: 20819
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. What do you expect it to do and what does it do instead?
 
Mathew Mintalm
Ranch Hand
Posts: 103
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally this code (with RSyntaxtText library included)

JPanel contentPane = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
contentPane.add(new RTextScrollPane(textArea));
setContentPane(contentPane);


Will show new kind of Text field (On full screen window... in this case, and i want to put in only in my JPane) with syntax highlighting, lines couting.

And i dont have idea how Can i add it ONLY into my JPane called jpanel1.

 
Rob Spoor
Sheriff
Posts: 20819
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RSyntaxTextArea is just a subclass of JTextArea (indirect). You can add it to any container you want just as you would do with other components. You do know how to work with layout managers, do you?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!