0

I'd like to have 2 JOptionPanes next to each other, one displaying info before a sort, one displaying after a sort. Currently my program just lays the panes on top of each other and making comparing the pre and post data difficult.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • 3
    Makes no sense to have two option panes with two sets of "Ok" "Cancel" buttons. However you can add a custom panel to a JOptionPane. See: https://stackoverflow.com/questions/17617390/how-to-set-manage-the-layout-of-joptionpane/17617861#17617861 for an example. The other option is to just create your own JDialog with whatever components you want. – camickr Sep 24 '21 at 23:44
  • Does this answer your question? [Can I use a Java JOptionPane in a non-modal way?](https://stackoverflow.com/questions/5706455/can-i-use-a-java-joptionpane-in-a-non-modal-way) – fakedad Sep 24 '21 at 23:54
  • 3
    `JOptionPane` isn't really the best choice of this. Instead, you should start with two `JPanel`s, each displaying the results you want, then add those to a third `JPanel` using a `GridLayout` and then finally, you can display that via a `JOptionPane` or on any window based component – MadProgrammer Sep 24 '21 at 23:56

0 Answers0