• Post Reply Bookmark Topic Watch Topic
  • New Topic

Don't understand JOptionPane Constructor  RSS feed

 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using a JOptionPane constructor, as follows:



Now, the point is, I don't get the sense of the third argument (JOptionPane.OK_CANCEL_OPTION) of the JOptionPane constructor, in combination with the fifth argument (the options array of objects).
Anything I put in the fifth argument is placed as option button at the bottom of the pane, so it seems to overrule the third argument completely.

So what's the sense of having this third param? Is there anybody who can clarify this?
 
Matt Swaggi
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hay friend ! JOptionPane.OK_CANCEL_OPTION This is used for cancel the action in the dialog box ! there are some more option like ! asfollows

ERROR_MESSAGE

A dialog that indicates an error to the user.

INFORMATION_MESSAGE

A dialog with an informational message to the user.

WARNING_MESSAGE

A dialog warning the user of a potential problem.

QUESTION_MESSAGE

A dialog that poses a question to the user. This dialog normally requires a response, such as clicking a Yes or a No button.

PLAIN_MESSAGE

A dialog that contains a message, but no icon

Hope its Useful !
 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I understand that.
My problem is that the fifth parameter (the options Object[]) seems to overrule the JOptionPane.OK_CANCEL_OPTION parameter completely in this particular 5-parameter constructor.

So what I don't understand is why this is a parameter if it doesn't seem to be used in this case.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!