Results 1 to 3 of 3
- 09-25-2012, 04:31 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Is this right to change the labels [row][2] into double?
String x = Double.parseDouble(labels[row][2]);?
I know this is a kinda of cross post but I need to do this for my final project ..
Java Code:JLabel[][] labels = new JLabel[5][3]; // index which row I am at int row = 0; DisplayPanel() { // 6 rows and 3 columns super(new GridLayout(6, 3, 5, 5)); // add the 3 header for(int i = 0; i < header.length; ++i) add(new JLabel(header[i])); // the other JLabel. Each row for(int i = 0; i < labels.length; ++i) { // each columns for(int j = 0; j < labels[i].length; ++j) { labels[i][j] = new JLabel(""); labels[i][j].setOpaque(true); labels[i][j].setBackground(Color.WHITE); add(labels[i][j]); } } } // adds the new entry into the next one void addFiedls() { if(row == labels.length) return; // sorry no more room labels[row][0].setText(id.getText()); labels[row][1].setText(name.getText()); labels[row][2].setText(sales.getText()); ++row;Last edited by opeboy; 09-25-2012 at 04:41 PM.
- 09-25-2012, 04:43 PM #2
Re: Is this right to change the labels [row][2] into double?
No 'kinda' about it.
How Can I Transfer The Data To Other Txtfield When Click Submit - Java | Dream.In.Code - Page 2
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 09-25-2012, 04:53 PM #3
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
GUI labels allignment
By dragon_baby in forum New To JavaReplies: 2Last Post: 06-17-2012, 05:32 PM -
Change backgroundcolor of Labels
By Jan D in forum New To JavaReplies: 2Last Post: 01-21-2012, 10:13 PM -
Change the integer variable to type double - is this right?
By Keke101 in forum New To JavaReplies: 1Last Post: 01-02-2012, 11:16 PM -
Printing labels to A4
By eggy524 in forum New To JavaReplies: 3Last Post: 09-23-2010, 04:53 PM -
change the delay between double click in mouse listener
By itaipee in forum AWT / SwingReplies: 6Last Post: 03-17-2009, 02:23 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks