Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

Andy Woods

Greenhorn
+ Follow
since Nov 29, 2001
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 Andy Woods

To all,
I am having a bit of trouble getting text from a editable JComboBox field. I have checked the earlier posts on this topic and i still seem to have trouble with this.
When the user clicks on a button i would like to get the data stored in a combo box? I populate the fields with data from a selected file. Isnt there an easier way to get data from a box than handling an event?
JComboBox AOnePos = new JComboBox;
AOnePos.setEditable(true);
.
.
.
Thanks.. Andy

20 years ago
Hello,
Is it possible to turn off the scrolling of the AWT Grid object? If so, what is the code to turn off the scoll bar of a grid.
Thanks
Andy
20 years ago
Hello,
Is it possible to paint over a background image? What I am trying to do is have a background image and only paint over a certain part (like a 5x5 pixel square) when an event happens. Also, the new painted over I would like to have a mouse over and display some information.
Or, should i create the main background graphic with spaces to place the painted section or a smaller 5x5 image?
Sorry for being cryptic of some sorts.. Just having a tough time following Java's Swing book for this..
Andy
woods_a@acadmn.mercer.edu
20 years ago
Also, if I declare implements ActionListener at the top of my class, i get an error saying that my main class should be declared abstract, does not define action performed. Yet, i have other methods that handle my stuff... ill just copy most of the file..

//{{REGISTER_LISTENERS
SymWindow aSymWindow = new SymWindow();
this.addWindowListener(aSymWindow);
SymAction lSymAction = new SymAction();
Exit.addActionListener(lSymAction);
AboutUs.addActionListener(lSymAction);
HelpTopics.addActionListener(lSymAction);
CreateStartingLineups.addActionListener(lSymAction);
class SymAction implements java.awt.event.ActionListener
{
public void actionPerformed(java.awt.event.ActionEvent event)
{
Object object = event.getSource();
if (object == Exit)
Exit_actionPerformed(event);
else if (object == AboutUs)
AboutUs_actionPerformed(event);
else if (object == HelpTopics)
HelpTopics_actionPerformed(event);
else if (object == CreateStartingLineups)
CreateStartingLineups_actionPerformed(event);

}
}
void CreateStartingLineups_actionPerformed(java.awt.event.ActionEvent event)
{
CreateLineups lineup = new CreateLineups();
}
this one above works...

Please HELP!!!
20 years ago
Hey,
I know i might be beating a dead horse, but I cannont make some button events work, even looking through Sun's Swing book.
Ok, I click on a meu item in my swing application. That brings up a JDialog box with 2 buttons on the bottom, Display and Close. When i clik close, i would like that JDialog box to be closed. Im just having problems handling button events.. here's my method

void HelpTopics_actionPerformed(java.awt.event.ActionEvent event)
{

JPanel buttonpanel = new JPanel();
JButton displayButton = new JButton("Display");
JButton closeButton = new JButton("Close");
displayButton.setToolTipText("Display highlighted topic");
closeButton.setToolTipText("Close Window");

final JDialog helpDialog = new JDialog(this, "Help Topics...", true);
helpDialog.setSize(400, 500);
JLabel soon = new JLabel("Coming Soon");
soon.setHorizontalAlignment(JLabel.CENTER);

Container dialogContentPane = helpDialog.getContentPane();
Container topsection = getContentPane();


JPanel buttons = new JPanel();
buttons.add(displayButton);
buttons.add(closeButton);


dialogContentPane.add(soon);
dialogContentPane.add(buttons, BorderLayout.SOUTH);

helpDialog.setLocationRelativeTo(this);
helpDialog.show();

closeButton.setActionCommand("Close");

closeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
helpDialog.setVisible(false);
helpDialog.dispose(); } } );

} // end of method
Any help will be GREATLY appreciated
Andy Woods
woods_a@acadmn.mercer.edu
20 years ago