http://www.alexwait.com/Java/ImageDisplay.jar
Please download that Jar file. So far all it does it add a button to the JFrame.
But there's a weird happening. The button doesn't always appear.
Once in awhile it will appear immediately.
But not often.
But if I immediately press where it should be, it comes up and stays.
I tried putting it "changeButton.setVisible(true)" in, but it didn't help.
Any ideas at all????
The entire code is below.
Please download that Jar file. So far all it does it add a button to the JFrame.
But there's a weird happening. The button doesn't always appear.
Once in awhile it will appear immediately.
But not often.
But if I immediately press where it should be, it comes up and stays.
I tried putting it "changeButton.setVisible(true)" in, but it didn't help.
Any ideas at all????
The entire code is below.
Code:
/**
* Write a description of class ImageDisplay here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class ImageDisplay extends JFrame //implements ActionListener
{
ImageDisplay(String title) {
//super(title);
CreateTheGUI();
SetWindowListeners();
JFrame mainFrame = new JFrame("Alex");
mainFrame.setSize(250,301);
mainFrame.setResizable(false); //don't let the user mess with the window
mainFrame.setVisible(true);
Dimension changeButtonD = new Dimension(40,40);
JButton changeButton = new JButton("Change Image");
changeButton.setSize(40,100);
changeButton.setMaximumSize(changeButtonD);
changeButton.setToolTipText("main Button this is");
changeButton.setHorizontalAlignment(SwingConstants.RIGHT);
changeButton.setVisible(true);
mainFrame.getContentPane().add(changeButton);
}
public static void CreateTheGUI() { //just a basic method
System.out.println("Creating The GUI!(3)");
}
public static void SetWindowListeners() {
}
public static void main(String[] args) {
ImageDisplay app = new ImageDisplay("ImageDisplay App");
}
}