Changing size of Joptionpane.showInputMessage

Asked

Viewed 793 times

5

I tried several methods like setPrefferedSize , setSize with/without pack() but nothing seems to affect Joptionpane

code:

        selectProcess = new JOptionPane();
    selectProcess.showInputDialog(null,"Please select game process","Select" , JOptionPane.QUESTION_MESSAGE, null ,processes.toArray(),null);

inserir a descrição da imagem aqui

It would have to be bigger to show more than one at a time?

  • Tried to use the method setMinimumSize?

  • I tried too, but nothing.

  • 1

    It really won’t do much good. This method is static, and it recreates a JOptionPane internally. I recommend if possible to reproduce the code by changing the size property of the JOptionPane. Have a look at the source code and you will see: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-B14/javax/swing/Joptionpane.java#Joptionpane.showInputDialog%28java.awt.Component%2Cjava.lang.Object%2Cjava.lang.String%2Cint%2Cjavax.swing.Icon%2Cjava.lang.Object%5B%5D%2Cjava.lang.Object%29

  • Is there no alternative to Joptionpane? I mean, some other library that does the same thing but provides the developer with more resources.

  • 1

    I could create a Voce myself, which is what I will do.. I thought I could change and save lines.

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.