Reputation: 951
i am trying to make some dialog window which ll naviagte me through the panel. So i made smth like that. Which is kinda good for me. But i have problem, how do make to rid of the icon and highlighted option?
Object[] options = {"one",
"two"};
int n = JOptionPane.showOptionDialog(this, "", "select one",
JOptionPane.CLOSED_OPTION,
JOptionPane.PLAIN_MESSAGE,
null,
options,
null);
there is setted selected object to null, icon to null. but they dont make any effect. When i added PLAIN_MESSAGE the icon disapeared but i still have highlited one of the buttons and 2nd the buttons are aligned to right, i need center aligment, help please. :)
Upvotes: 0
Views: 120
Reputation: 324088
but i still have highlited one of the buttons
This is the default behaviour of a JOptionPane.
Check out Dialog Focus for an approach that you may be able to use that will allow you to add your own component to the option pane and place focus on that component.
the buttons are aligned to right, i need center aligment,
Again this is the default and there is no easy way to change this.
For full customization you will need to create a custom JDialog.
Upvotes: 1