|
-
March 4th, 2009, 10:31 AM
#1
JOptionPane doesnt seem to be working...
Code:
//Create JButton named "NewTree"
JButton NewTree = new JButton("Create a new tree");
//Add action Listener
NewTree.addActionListener (new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
Object[] options = {"Strings", "Integers"};
int n = JOptionPane.showOptionDialog(null, "Which type of data will you be using in your tree?", "Data Type?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, options, options [2]);
}
});
Jcreator seems to think that the error seems to be on this this part of the code...
Code:
int n = JOptionPane.showOptionDialog
the error message is...
showOptionDialog(java.awt.Component,java.lang.Object,java.lang.String,int,int,javax.swing.Icon,java.lang.Object[],java.lang.Object) in javax.swing.JOptionPane cannot be applied to (<nulltype>,java.lang.String,java.lang.String,int,int,java.lang.Object[],java.lang.Object)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|