Shaifali Agrawal

Greenhorn
+ Follow
since Jun 21, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shaifali Agrawal

Hello I am developing a desktop application in which I want Admin have option to delete users, for which I planned that whenever Admin clicks on 'delete users' button a new tab will open in which check boxes with the name of all existing users in my database should appear(so that he can delete multiple users simultaneously); so basically I need to generate dynamic check boxes as per my database.

I am using netbeans, jdk 1.6, sqlite3.

I have tried to follow the code above given by @Gopu Akraju but like @Peter Kanchar its not working for me too. What I does is just created new JFrame in netbeans and called a method inside constructor, method's code is as below:

public void generatingCheckboxesDynamically(){
JPanel dPanel = new JPanel();
add(dPanel);
getContentPane().add(new JScrollPane(dPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
for (int i=0; i<5; i++){
JCheckBox box = new JCheckBox("region"+i);
dPanel.add(box);
dPanel.revalidate();
}
}

Please help me to know where I am wrong!!
And yes this code is not connected to database yet, once it will work then I can modify it to work with database.

Also is there any other more better way to accomplish my task?
10 years ago