jinternalframe

JDesktopPane placement

主宰稳场 提交于 2019-12-13 14:28:17
问题 I have a JDesktopPane and want to display JInternalFrames in a grid style without overlaying frames. The dymensions of the frames will vary so their location should be assigned dynamically. I could store the coordinates of the last placed frame but frames can be moved, minimized or closed.. Is their an easy way of placing internal frames in a tidy way? e.g., using a Layout? 回答1: Here's an example that may offer some guidance. It uses setLocation() and an offset. 回答2: The DesktopManager class

How to bring jinternalframe to front from all opened jinternalframes?

淺唱寂寞╮ 提交于 2019-12-13 05:46:35
问题 This is my source code. I can't get my JInternalframe to the front. I have tried many codes out there, but nothing worked. private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) { boolean b = true; JInternalFrame[] j = jDesktopPane1.getAllFrames(); no = new NewOrder(); for (JInternalFrame Ji : j) { if (Ji.isShowing()) { b = false; break; } } if (!b) { no.requestFocus(true); } else { dm = jDesktopPane1.getDesktopManager(); jDesktopPane1.add(no); dm.setBoundsForFrame(no,

Exception in the iconization of JInternalFrame with DefaultDesktopManager

人走茶凉 提交于 2019-12-12 22:11:21
问题 I am trying to use DefaultDesktopManager (or a sub-class of this) to control the moves out of JInternalFrames from a desktop panel. I can prevent that a frame is moved out of its desktop pane, however, when I minimize the internal frame I get: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.RepaintManager.getVolatileOffscreenBuffer(RepaintManager.java:965) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1398) at javax.swing

JInternalFrame in full-screen mode

青春壹個敷衍的年華 提交于 2019-12-12 17:20:18
问题 I intend to use a JInternalFrame as a modal JDialog in full-screen mode, however, it is not currently being shown when it gets called. Do I need to add it to some container? I tried adding it to a JOptionPane.showInternalMessage(...), but since I want to make the dialog to go away automatically after 3 seconds, this would not work, as the the JOptionPane dialog would just stay there until someone clicks OK. Any idea? Many thanks. 回答1: Yes you have to add it to a container in which you want it

How to get the z order of JInternalFrames in a JDesktopPane

狂风中的少年 提交于 2019-12-12 09:42:28
问题 How would one go about getting the z order (layer depth of ) all the JInternalFrames inside a JDesktopPane. There does not seem to be a straight forward way for this. Any ideas? 回答1: Although I haven't tried this, the Container class (which is an ancestor of the JDesktopPane class) contains a getComponentZOrder method. By passing a Component which is in the Container , it will return the z-order of as an int . The Component with the lowest z-order value returned by the method is drawn last,

How to Lock Jinternal Frame inside JDesktopPane

╄→гoц情女王★ 提交于 2019-12-12 00:28:51
问题 I am using JDesktopPane and Jinternal Frame . I want to Lock Jinternal Frame inside JDesktopPane . Suggest which method or property needs to change. 回答1: You could Supply your own DesktopManager and manage the setFrameBounds method Implement your own internal frame & override the setBounds(x, y, width, height) , & maintain the position by supplying your own x, y values to the super call. 来源: https://stackoverflow.com/questions/11556044/how-to-lock-jinternal-frame-inside-jdesktoppane

JDesktopPane - minimising JInternalFrames

ぐ巨炮叔叔 提交于 2019-12-11 23:58:05
问题 I working with JDesktopPane and creating multiple JInternalFrame objects. When I minimize all and maximize any one of them, the opened frame covers all minimized frames. How to make all minimized frames visible? 回答1: By default the internal frame is maximized to take all the space of the desktop. This behaviour is relatively easy by change by customizing the DesktopManager . For example: import java.awt.*; import javax.swing.*; import java.beans.PropertyVetoException; class

How to call a jdialog from a jinternalframe

最后都变了- 提交于 2019-12-11 13:17:47
问题 I have an internalframe, i want to create an evenet private void errorTableMouseClicked(java.awt.event.MouseEvent evt) { PaneDialog dlg = new PaneDialog(**this**,true); } now the PaneDialog is an JDialog, i cant put the constructor "this" cus "this" is InternalFrame so Netbeans shows an error incompatible types, PaneDiaglog can not be converted to Frame, how i call the JDialog in internalframe? 回答1: Maybe you can use one of the JOptionPane.showInternal???(...) methods since they only need a

How to Disable/Enable JFrame Component when JInternalFrame isVisible inside JFrame/JDesktopPane?

本秂侑毒 提交于 2019-12-11 11:50:56
问题 How to Disable/Enable JFrame components when JInternalFrame isVisible inside JFrame / JDesktopPane ? For example, make every JInternalFrame1 visible on the JDesktopPane (desktop pane set on the JFrame ) all frame components like JMenuBar / JButton /etc. set disabled. Have a solution? 回答1: If you have a reference to all your components, the best shot is to write a simple method that would disable everything (more or less like a state machine). If you don't have a reference to all of them (like

How to adjust an application (JFrame) with every kind of screens?

痞子三分冷 提交于 2019-12-11 10:39:12
问题 i have been working on a Swing application that has a JFrame as principal Frame and it contains a lot of JInternalFrames inside of it , and when i installed it in every computer in the company, it seems that some computers screen size is lower and more tight then the screen in wish i had developed my application, and that is not useful, so i am asking if i can adjust my application (Frames) to every kind of screen size, i am using Swing API. Thank you. 回答1: You can check the size of the