可以用这个阿
public static void showMessageDialog(Component parent,Object message,String title,int messagetype,Icon icon)
是这个意思么?
public static void showMessageDialog(Component parent,Object message,String title,int messagetype,Icon icon)
是这个意思么?
import javax.swing.JOptionPane;
public class applit {
public static void main(String args[]) {
String alpha = "asdflkaodsdjfa";
JOptionPane.showMessageDialog(null, alpha);
System.exit(0);
}
}
我不希望消息框上面的java图标和那个蓝体圆框i显示出来
我只要取消它们就行,并不需要其它的,该如何做?
如果需要自己编写新CLASS,请给点代码
JOptionPane.showMessageDialog( null, "This is a test", "Title",
JOptionPane.PLAIN_MESSAGE );
JOptionPane pane = new JOptionPane( "This is a test",
JOptionPane.PLAIN_MESSAGE );
JDialog dialog = pane.createDialog( null, "Title" );
dialog.setResizable( false );
dialog.show();
Font f = new Font( "Serif", Font.ITALIC, 36 );
JLabel label = new JLabel( "This is a test." );
label.setFont( f );
JOptionPane pane = new JOptionPane( label,
JOptionPane.PLAIN_MESSAGE );
JDialog dialog = pane.createDialog( null, "Title" );
dialog.setResizable( false );
dialog.show();