Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JCheckBox in JTextArea/JLabel  RSS feed

 
darshan sure
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

I need to add JCheckBox es based on a 'number' returned from a query. As that 'number' varies I need to have a scrolling option on the component to which I add this Jcheckbox.

I tried something like this



but this did not work.


Any suggestion is appreciated!

Many Thanks..
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be adding the check boxes to a JPanel.

Read the JCheckBox API and follow the link to the Swing tutorial on "How to Use Check Boxes" for example. The tutorial also shows how to use a scroll pane.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!