我看了Dialog类的说明可以指定owner,frame创建~~但我用this为什么总创建不了,owner指的是this可以吗?请指点~~

解决方案 »

  1.   

    不行,JDialog的构造函数没有applet的,只能是frame或dialog,而applet不继承他们java.lang.Object
      java.awt.Component
          java.awt.Container
              java.awt.Panel
                  java.applet.Applet
                      javax.swing.JApplet
    JDialog() 
              Creates a non-modal dialog without a title and without a specified Frame owner. 
    JDialog(Dialog owner) 
              Creates a non-modal dialog without a title with the specified Dialog as its owner. 
    JDialog(Dialog owner, boolean modal) 
              Creates a modal or non-modal dialog without a title and with the specified owner dialog. 
    JDialog(Dialog owner, String title) 
              Creates a non-modal dialog with the specified title and with the specified owner dialog. 
    JDialog(Dialog owner, String title, boolean modal) 
              Creates a modal or non-modal dialog with the specified title and the specified owner frame. 
    JDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc) 
              Creates a modal or non-modal dialog with the specified title, owner Dialog, and GraphicsConfiguration. 
    JDialog(Frame owner) 
              Creates a non-modal dialog without a title with the specified Frame as its owner. 
    JDialog(Frame owner, boolean modal) 
              Creates a modal or non-modal dialog without a title and with the specified owner Frame. 
    JDialog(Frame owner, String title) 
              Creates a non-modal dialog with the specified title and with the specified owner frame. 
    JDialog(Frame owner, String title, boolean modal) 
              Creates a modal or non-modal dialog with the specified title and the specified owner Frame. 
    JDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) 
              Creates a modal or non-modal dialog with the specified title, owner Frame, and GraphicsConfiguration. 
      

  2.   

    谢谢,这个我构建成功了,但是没有像VB的Msgbox这样方便一点的吗?