JInternalFrame中,弹出JDialog窗口,窗口切换后JDialog窗口找不到了,必须要用alt+tab键才能显示,这是为什么 JDialog没有指定父窗口,构造函数里有 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 “不管怎么切换窗口,JDialog总是在最上面”?既然能切换其它窗口,JDialog干吗还要在上面如果JDialog总在最上面的话,用JDialog(Frame owner, boolean modal) 第二个参数设为true第二个问题,跟通常用法没有什么区别,你使用一个数据库总要知道ip地址吧 还有一个问题,怎么样才能访问internet上的数据库 在jdbc数据源中把数据库指到远程机器上的数据库 哦,看错了,以为是odbc驱动ms的sql server 2000的jdbc驱动的url是这样写的"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=haiguan"; localhost换成远程机器ip JDialog是否可以指定JInternetFrame为父窗口 如果你指定JDialog的父窗口为null的话,即便你把JDialog设为模态的也不行,即出现你说的问题!既然有JInternetFrame,那当然也有JDesktopPane了,你把JDesktopPane设为JDialog的父窗口就可以了! JDialog的父窗口可以是JDesktopPane吗?如果构造函数可以写成FrameRootNode(JDesktopPane frame, String title,boolean modal)吗? 用这个JOptionPane.showInternalOptionDialog(Component parentComponent,Object message,String title,int optionType,int messageType,Icon icon,Object[] options,Object initialValue) 类似的还有:static int showInternalConfirmDialog(Component parentComponent, Object message)static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType)static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)static String showInternalInputDialog(Component parentComponent, Object message)static String showInternalInputDialog(Component parentComponent, Object message, String title, int messageType)static Object showInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)static void showInternalMessageDialog(Component parentComponent, Object message)static void showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType)static void showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)static int showInternalOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)具体使用方法参看文档 我的界面是这样的:JInternetFrame里面有一个按钮,点这个按钮探出一个JDialog,然后再JDialog里面输入信息保存后退出JDialog 那你就用showInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)用法自己查文档。你不是要我帮你查吧?哈哈 怎样取得JInternalFrame的父窗口 父窗口类是FrameMain,怎样取得父窗口 干吗要取父类窗口,用JInternalFrame做parentComponentJOptionPane.showInternalInputDialog(internalFrame,...); 我现在的程序是已经以继承了JDialog类,并且在里面添加了很多信息,保存信息后还有返回值用JOptionPane.showInternalInputDialog可以把internalFrame当作父窗口,但是能不能显示自定义的JDialog呢 在产生JDialog的那个类中持有父窗口的一个引用 问题已解决,我写得JDialog的构造函数中,父窗口是Frame,所以我在父窗口类中添加了一个方法public static FrameMain parent = null;public FrameMain() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public static FrameMain getFrame(){ return parent; }然后再JInternalFrame中调用FrameMain.getFrame(),得到父窗口的引用,这样JDialog的父窗口就可以设为FrameMain 问题已解决,我写得JDialog的构造函数中,父窗口是Frame,所以我在父窗口类中添加了一个方法public static FrameMain parent = null;public FrameMain() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); parent = this; } catch(Exception e) { e.printStackTrace(); } } public static FrameMain getFrame(){ return parent; }然后再JInternalFrame中调用FrameMain.getFrame(),得到父窗口的引用,这样JDialog的父窗口就可以设为FrameMain 历元不是1970-1-1零点 菜鸟提问。。赋值的问题。。 静态类型检查? ava正则匹配问题 弱弱地问一下,Java的便变量命名问题? 看看我这是为什么呀? 问个JNI的问题 哪里有Borland OptimizeIt 5.5 的Crack下载? 我在测试我.class文件时总提示这样的错误:Exception in thread "main" java.lang.noclassdefoundError:myclass 请问斑竹!!!你这论坛是用java语言编的吗????如果是可否教教我???? 高手来帮一下,我想这样做! 菜鸟提问:J2EE和J2SE的区别?
既然能切换其它窗口,JDialog干吗还要在上面
如果JDialog总在最上面的话,用
JDialog(Frame owner, boolean modal)
第二个参数设为true第二个问题,跟通常用法没有什么区别,你使用一个数据库总要知道ip地址吧
ms的sql server 2000的jdbc驱动的url是这样写的
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=haiguan";
localhost换成远程机器ip
既然有JInternetFrame,那当然也有JDesktopPane了,你把JDesktopPane设为JDialog的父窗口就可以了!
如果构造函数可以写成FrameRootNode(JDesktopPane frame, String title,boolean modal)吗?
JOptionPane.showInternalOptionDialog(Component parentComponent,Object message,String title,
int optionType,int messageType,Icon icon,Object[] options,Object initialValue)
static int showInternalConfirmDialog(Component parentComponent, Object message)
static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType)
static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
static int showInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
static String showInternalInputDialog(Component parentComponent, Object message)
static String showInternalInputDialog(Component parentComponent, Object message, String title, int messageType)
static Object showInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
static void showInternalMessageDialog(Component parentComponent, Object message)
static void showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType)
static void showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
static int showInternalOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
具体使用方法参看文档
showInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
用法自己查文档。
你不是要我帮你查吧?哈哈
JOptionPane.showInternalInputDialog(internalFrame,...);
用JOptionPane.showInternalInputDialog可以把internalFrame当作父窗口,但是能不能显示自定义的JDialog呢
public FrameMain() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
} public static FrameMain getFrame(){
return parent;
}
然后再JInternalFrame中调用FrameMain.getFrame(),得到父窗口的引用,这样JDialog的父窗口就可以设为FrameMain
public FrameMain() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
parent = this;
}
catch(Exception e) {
e.printStackTrace();
}
} public static FrameMain getFrame(){
return parent;
}
然后再JInternalFrame中调用FrameMain.getFrame(),得到父窗口的引用,这样JDialog的父窗口就可以设为FrameMain