import
java.awt.*;
import
javax.swing.*;
import
java.awt.event.*;
class
message2
implements
ActionListener {
JWindow w;
message2()
{
w =
new
JWindow();
w.setBackground(
new
Color(
0
,
0
,
0
,
0
));
JLabel l =
new
JLabel(
"This is a message dialog"
);
JButton b =
new
JButton(
"OK"
);
b.addActionListener(
this
);
try
{
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
}
catch
(Exception e) {
}
JPanel p =
new
JPanel() {
public
void
paintComponent(Graphics g)
{
g.setColor(
new
Color(
100
,
100
,
240
));
g.fillRoundRect(
0
,
0
,
200
,
100
,
20
,
20
);
g.setColor(
new
Color(
10
,
10
,
255
));
g.drawRoundRect(
0
,
0
,
200
,
100
,
20
,
20
);
for
(
int
i =
0
; i <
100
; i++) {
g.setColor(
new
Color(
255
,
255
,
255
, i));
g.drawLine(
0
, i,
200
, i);
}
}
};
Font f =
new
Font(
"BOLD"
,
1
,
14
);
l.setFont(f);
p.add(l);
p.add(b);
w.add(p);
w.setSize(
200
,
100
);
w.setLocation(
300
,
300
);
w.show();
}
public
void
actionPerformed(ActionEvent evt)
{
w.setVisible(
false
);
}
public
static
void
main(String args[])
{
message2 m =
new
message2();
}
}