Need simple ok alert dialog

Hi all,

I need a simple alert dialog to display a message with an ok button. I wrote on but it is not always displayed properly. Some times the background color of the panel which contains the button is not shown. This is the code I used.

public Alert(String s) {

super(new Frame(),"eDrugstore.md" ,true);

add("Center", new Label(s));

Panel p = new Panel();

p.setLayout(new FlowLayout());

Button b = new Button("OK");

b.addActionListener(this);

p.add(b);

add("South", p);

setSize(300,100);

setLocation(100,200);

}

rgds

Antony Paul

[628 byte] By [Antony.Paul] at [2007-9-30 20:52:34]
# 1
use JOptionPane
Praveeen at 2007-7-7 2:25:28 > top of Java-index,Desktop,Core GUI APIs...