...

Scrollable GUI app in JAVA

JAVAEOC
08-30-2004, 10:46 PM
Hi guys,

import javax.swing.*;
import BreezySwing.*;

public class StudentTestScores extends GBFrame{

JButton Submit, Shuffle;

public StudentTestScores(){
JLabel nameLabel;
JTextField nameField;

Submit = addButton ("Submit" ,1,1,1,1);
Shuffle = addButton ("Suffle" ,1,2,1,1);

for(int i=0; i<=10; i++) {
nameLabel = addLabel ("Name" ,i+2,1,1,1);
nameField = addTextField ("" ,i+2,2,1,1);
}
}

public void buttonClicked (JButton buttonObj){
if (buttonObj == Submit){};
}

public static void main (String[] args){
StudentTestScores theGUI = new StudentTestScores();
theGUI.setSize (200, 800);
theGUI.setVisible(true);
}
}


The above code is the start of one of my little projects, however I need to archive the same GUI window as the above program does, the only thing is i have to be able to refer back to all the textareas...

So how could I do that?

And How could I make everything scroll so it isnt that squeezed...

thanks guys :)

andrewsco
08-31-2004, 09:48 AM
Im kind of new to java, but dont you have to set up actionlistners for your buttons, so that if you want an event to happen, it can? not too great on GUI's, but that was the bit that I found the hardest.

Andy

JAVAEOC
08-31-2004, 09:25 PM
That is the problem i have, I cant refer to all of them cause they all have the same name :(

Antoniohawk
08-31-2004, 09:53 PM
I'm new to java also. Is there some way to tack on the iterating variable to the name of the gui components? Like, nameLabel1, nameLabel2, etc.

JAVAEOC
09-01-2004, 09:21 PM
thats what I am trying to do, but it seems that I can not make an array full of objects....

thanks for any ideas



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum