I try to hide JOptionPane's title bar.It is not ok.But by using "Popup" window,it will help you to get what you want.I try to use it,"Popup".It works well.Code is here.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Popup;
import javax.swing.PopupFactory;
public class SwingTest extends JFrame{
JButton rightbutton,btnOk,btnCancel;
JPanel panel;
JLabel lblMsg;
Popup popup;
public SwingTest(){
setSize(300,300);
rightbutton=new JButton("Right");
rightbutton.setBounds(100, 100, 80, 30);
//Message you want to show
lblMsg=new JLabel("Congratulations, you clicked the button.");
lblMsg.setBounds(30, 30, 200, 18);
btnOk=new JButton("Ok");
btnOk.setBounds(30, 60, 30, 30);
btnCancel=new JButton("Cancel");
btnCancel.setBounds(70, 60, 80, 30);
panel=new JPanel();
panel.setSize(250,200);
panel.add(lblMsg);
panel.add(btnOk);
panel.add(btnCancel);
//Create Popup
PopupFactory factory=PopupFactory.getSharedInstance();
popup=factory.getPopup(this, panel, 100, 100);
add(rightbutton);
rightbutton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
popup.show();
}
});
btnOk.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
popup.hide();
}
});
btnCancel.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
popup.hide();
}
});
}
public static void main(String[] args) {
new SwingTest().setVisible(true);
}
}
May this code be a part of that you want.Thanks