0

I'm trying to design the dialog box to go with the theme(1) of my application. Any idea how to do it?

  1. I mean the colour scheme of my application, it's green and white.
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
CodeMan
  • 23
  • 5
  • 1
    For most flexibility, create your own modal JDialog to use in place of a JOptionPane. – DontKnowMuchBut Getting Better Jun 18 '17 at 11:24
  • @DontKnowMuchButGettingBetter Thanks but could u pleasw elaborate on that? – CodeMan Jun 18 '17 at 11:31
  • 1
    First you: please elaborate on just what you mean by "theme of my application" -- do you mean "Look & Feel"? Or something different? Also have you checked out the tutorials on how to create JDialogs as well as check out the API. They are worth a look. – DontKnowMuchBut Getting Better Jun 18 '17 at 11:33
  • @DontKnowMuchButGettingBetter Thanks a lot for pointing out the right direction. I meant the colour scheme of my application, its green and white. The dialog box looks odd. But now ill design it. Sorry if it was a newbie question, im just 15 and a beginner! – CodeMan Jun 18 '17 at 11:38
  • If you're asking about L&F, then be sure to set it **before** displaying the JOptionPane. Timing is everything here. – DontKnowMuchBut Getting Better Jun 18 '17 at 11:41
  • There are some examples of this sort of thing [here](https://stackoverflow.com/q/12234850/2891664). Depending on what you want, you might have to e.g. extend `JDialog` instead. If you update your question with more specific details you will potentially get a much better answer. – Radiodef Jun 18 '17 at 12:00
  • 1
    *"I meant the colour scheme of my application, its green and white."* The best way to achieve that is by using a custom PLAF (Pluggable Look and Feel). It's 'best' for many reasons, including that the look of the `JOptionPane` should change automatically (without any extra code). BTW - The Java code for the solution is the same in any IDE, so mentioning and tagging the IDE is neither necessary nor advisable. – Andrew Thompson Jun 18 '17 at 12:15

0 Answers0