JDialog transparent
I have a JDialog that closes when a variable in another class changes. It works fine but the problem is that the dialog is transparent! The outside parts of the window are visible but the interior is see through. Here is how I set up the JDialog:
boolean visible;
JButton stop;
final JDialog playingDialog =new JDialog(frame,"Playing...",false);
ImageIcon dialogIcon =new ImageIcon(stupidWindowsPath +"images\\dialog.png");
playingDialog.getContentPane().setLayout(new playLayout());
JLabel dialogLabel=new JLabel(dialogIcon);
JLabel playing=new JLabel("Playing...");
status.setMessage("Playing..");
dialogLabel.setIcon(dialogIcon);
playingDialog.getContentPane().add(dialogLabel);
playingDialog.getContentPane().add(playing);
stop =new JButton("Stop");
playingDialog.getContentPane().add(stop);
stop.addActionListener(new ActionListener(){
publicvoid actionPerformed(ActionEvent e){
orhb.stopPlay();
playingDialog.setVisible(false);
}
});
playingDialog.setSize(272, 119);
playingDialog.setLocation(186,294);
playingDialog.setResizable(false);
playingDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
visible=true;
playingDialog.setVisible(visible);
while(visible)
if(CONDITION FROM OTHER CLASS)
visible=true;//i've tried putting playingDialog.repaint() in here
else
visible=false;
playingDialog.setVisible(visible);
When I take out the while loop the dialog shows up but does not close when the condition is met (obviously). Does anyone have any suggestions for me?

