I'm trying to write a program where I use JOptionPane
at different places in the code.
Example:
String btcRate = JOptionPane.showInputDialog(screen, "insert \ntodays rate!");
JOptionPane.showMessageDialog(screen, "Name or password incorrect");
I'd like to have some kind of class or method that defines all my JOptionPane
s, so that they all have a max width of 260 and 150 height and are at the same location on the screen.
Is this possible?
I've looked at code like this:
JOptionPane pane = new JOptionPane();
JDialog dialog = pane.createDialog("ej");
dialog.setSize(300,300);
dialog.locate(10, 10);
dialog.show();
But how do I use it on for example showInputDialog
, and can I make a class or method to handle them all?