Results 1 to 2 of 2
- 02-12-2008, 07:10 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
Can we add JCheckBox array into JTextArea?
I cannot add the JCheckBox array one by one within the JTextArea, but only can add them into the JPanel one by one.
Is it possible to add the JCheckBox array within the JTextArea ??
Thanks !!
Nancy
Code:
..
..
...
rightUpper_left = new JPanel(); //right upper left panel
rightUpper_left.setLayout(new GridLayout(3, 1));
textArea2 = new JTextArea(22,60);
textArea2.setEditable(false);
image = new JCheckBox[3];
for (int i = 0; i < 3; i++)
{
image[i] = new JCheckBox(getImageData(i+1) + "" + anno_label);
//textArea2.append(image[i] + "");
//textArea2.append(image[i].toString());
rightUpper_left.add(image[i]);
}
for (int i = 0; i < 3; i++)
{
CheckBoxHandler handler = new CheckBoxHandler();
image[i].addItemListener(handler);
}
textArea2.setText(getImage());
rightUpper_left.add(new JScrollPane(textArea2,JScrollPane.VERTICAL_SCROLLB AR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEED ED));
..
..
- 02-17-2008, 12:07 AM #2
Similar Threads
-
JTextArea setting
By newtojava7 in forum New To JavaReplies: 1Last Post: 01-29-2008, 02:57 AM -
JTextArea
By saytri in forum New To JavaReplies: 0Last Post: 01-13-2008, 01:07 AM -
jcheckbox issues need help. thanks.
By carlos123 in forum New To JavaReplies: 3Last Post: 11-05-2007, 10:37 PM -
using JCheckBox, JButton and JTextArea with JDBC
By warship in forum JDBCReplies: 1Last Post: 08-08-2007, 01:25 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks