KathySmith SmithL

Greenhorn
+ Follow
since Oct 17, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by KathySmith SmithL

Is there a way to connect to the DB from WML through XSLT? Can I read the variables input in WML GUI and write it into an XML file, so I can write it into the DB later?

Thanks,
Kathy
20 years ago
Thank you so much.. it works fine now.. I just added the part where u are adding the code setPreferredScrollableViewportSize and adding it to the scrollPane and it worked like a charm.
20 years ago
This is all the code I have to display the data in the jtable. Doesn't the stmts,
jtbl_Alert = new JTable(mydata, heading);
and
jtbl_Alert.setVisible(true);
display the data? Is there more to this to display the data seperately? This is all I found in the examples..
20 years ago
The new code executes without any errors.. but the table is not displayed correctly and also there is no data in it.. all I see is just a block of white patch on the GUI
20 years ago
Thanks, I tried that.. there won't be any exception, but the display is still not coming.. is there anything else that I need to add?
Here's my changed code:

20 years ago
hi, can anyone tell me what I'm doing wrong here? The data is coming from a db and is stored in the alrtRslts vector. The data in the alrtRslts vector is correct. The print statement prints the data correctly.
I'm getting a classCastException when I create new JTable(data, heading).
Pls help me solve this.. I need this urgently..

[ November 01, 2004: Message edited by: KathySmith SmithL ]
20 years ago

Originally posted by Craig Wood:



Thanks for the code Craig.. but u have hardcoded the values.. so it is easy to directly add the values.. but when I have dynamically input values, how do I do the same ?? I don't even know the order in which I'll get the values.. like C1 may first come and then C2 may come in the vector that contains the objects and then again I might get a C1-F1-S2 value.
[ October 23, 2004: Message edited by: KathySmith SmithL ]
20 years ago
I too need to do something like that..
how do I get this value and the index of it, so that I can add more children to it if it is equal to my value??

For example, I have a Vector with objects that have 3 values like
Vector(0) = Obj1 where Obj1(0)=C1, Obj1(1)=F1, Obj1(2)=S1
Vector(1) = Obj2 where Obj2(0)=C1, Obj2(1)=F1, Obj2(2)=S2
Vector(2) = Obj3 where Obj3(0)=C2, Obj3(1)=F2, Obj3(2)=S2
Vector(3) = Obj4 where Obj4(0)=C1, Obj4(1)=F2, Obj4(2)=S1

now how will I construct a tree from this? I'm trying a lot to get this working.. but somehow the constructed tree doesn't exactly match my requirement. Can somebody please help me..
the output tree I need is :
Root
-C1
_|-F1
____|-S1
____|-S2
_|-F2
____|-S1
-C2
_|-F2
____|-S2

and so on..
[ October 22, 2004: Message edited by: KathySmith SmithL ]
20 years ago
Thanks.. it worked.. my chkboxes were not an arrayList... hence I tried it in a different way.. used a Vector instead of the arrayList to store the individual checkboxes created and checked if each element in the vector was selected.

Kathy
20 years ago
Hi all,
I'm new to Swing and I'm still learning and experimenting with the controls. I have dynamically created Checkboxes based on the resultSize. I need to store the selected checkboxes into an array or Vector. I am unable to find out which ones are selected by the user. Can someone help me with this problem?
--------------------------------------
I have a dynamically created chkboxes like this:
// some code....
Container cont = getContentPane();
JPanel jp = (JPanel) cont.getComponent(0);
JTabbedPane jtbp = (JTabbedPane) jp.getComponent(0);
jp = (JPanel) jtbp.getComponent(1);
int rsltSize = srchrslts.size();

if (rsltSize != 0) {
for (int i = 0; i < rsltSize; i++) {
jChkBox_results = new JCheckBox();
jChkBox_results.setName("jChkBox_results"+ (i+1));
jChkBox_results.setPreferredSize(new Dimension(273, 17));
jChkBox_results.setText(srchrslts.get(i).toString());
jp.add(jChkBox_results);
}

JButton btn_ShowSoln = new JButton();
btn_ShowSoln.setText("Show Solutions");
jp.add(btn_ShowSoln);
btn_ShowSoln.addActionListener(new GUIFrame_btn_ShowSoln_actionAdapter(this));

this.validate();
this.setVisible(true);
}
else {
// send an alert - no results found
createAlert();
}



In btn_showSoln, I need to store the selected checkboxes into a vector to process later

void btn_ShowSoln_actionPerformed(ActionEvent e) {
try {
for(int i = 0; i < rsltSize; i++) {
if(jChkBox_results.getName().equals("jChkBox_results" + (i+1))){
System.out.println("Selected chk boxes are : ");
System.out.println(jChkBox_results.getName());
}
}

}
catch (NullPointerException npe) {
//display alert to user saying nothing was checked.
System.out.println("Please check atleast one record !!!");
}
}

-----------------------------

Everytime I get the last added checkbox name printed n number of times depending on the resultSize.. is there any other way to get the selected checkboxes??

Thanks in advance
Kathy
20 years ago