Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JCheckBox in JTextArea/JLabel  RSS feed

 
Shwetha Suresh
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: 2787
12
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!