public class NoticeView extends JWindow implements ActionListener {
private static final long serialVersionUID = 7125782553222257225L;
public NoticeView(String msg) {
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
try{
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch(Exception ex){
//ex.printStackTrace();
}
setBackground(Color.LIGHT_GRAY);
setLayout(null);
setSize(new Dimension(250, 120));
setPreferredSize(new Dimension(250, 120));
setAlwaysOnTop(true);
setLocation((e.getMaximumWindowBounds().width-250+e.getMaximumWindowBounds().x), (e.getMaximumWindowBounds().height-120+e.getMaximumWindowBounds().y));
JButton btnX = new JButton("X");
btnX.setBounds(205, 0, 45, 45);
btnX.addActionListener(this);
add(btnX);