title: UIManager in Button Action
body: <p>I have one <code>LoginScreen</code> and one <code>MainWindow</code>. When connection attempt succeed to DB, LoginScreen <code>disposed</code> and MainWindow appear.</p>
  
  <p>I have one button has <code>ActionListener</code> for create a <code>JOptionPane</code>. Code succesfully working actually. I have three problems in <code>Painting</code> i think. Let me explain problems one by one;</p>
  
  <p><strong>Problem 1;</strong></p>
  
  <pre><code>UIManager UI=new UIManager();
  Object paneBG = UI.get("OptionPane.background");
  Object panelBG = UI.get("Panel.background");
  UI.put("OptionPane.background", Color.red);
  UI.put("Panel.background", Color.red);
  
  String[] buttons2 = { "EXIT", "OK" };
  int rc2 = JOptionPane.showOptionDialog(MainWindow.this, 
                                          panel,
                                          "User Input", 
                                          JOptionPane.INFORMATION_MESSAGE,
                                          JOptionPane.PLAIN_MESSAGE, 
                                          icon, 
                                          buttons2, 
                                          buttons2[1]
                                        );
  
  UI.put("OptionPane.background", paneBG);
  UI.put("Panel.background", panelBG);
  </code></pre>
  
  <p>I use above code for change <code>background color</code> of <code>OptionPane</code>, show to user and rollback the UI colors to original.</p>
  
  <p>If i directly run the <code>MainWindow</code> and click the button, color changed (<em>sure panel and buttons area keep original colors in OptionPane, but other OptionPane areas turn to red. This is another issue</em>) like this;</p>
  
  <p><a href="https://i.stack.imgur.com/QnCYv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QnCYv.png" alt="enter image description here"></a></p>
  
  <p>But when i come from <code>LoginScreen</code>, login attempt succeed, LoginScreen <code>disposed</code> and MainWindow appear. I click to same button but <code>OptionPane</code> not painted now, like this;</p>
  
  <p><a href="https://i.stack.imgur.com/mxGY0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mxGY0.png" alt="enter image description here"></a></p>
  
  <p><strong>Problem 2;</strong></p>
  
  <p>I have another button in MainWindow and it create another OptionPane. I directly run the MainWindow and click first button (which has change the UI color and rollback action), close it than click second button (which has another OptinPane) OptionPane still painted so UI colors not rollback to default values.</p>
  
  <p><strong>Problem 3;</strong></p>
  
  <p>If we solve the first and second problem, How can i make <code>transparent</code> these inner panels (which has label and textfield panel one and buttons one)</p>