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 I can selected by default an InternalFrame on a JDesktopPane?

风格不统一 提交于 2019-12-11 04:59:39
问题 I have a JFrame with the JDesktopPane and inside the JDesktopPane, I launch with the constructor a JInternalFrame. (Its a app like the authentification users, with the textbox user and textbox pass) I lauch the internal like this: MyInternalFrame internalF = new MyInternalFrame(); desktopPane.add(internalF); I try with: internalF.setVisible(true); internalF.setSelected(true); desktopPane.getDesktopManager().activateFrame(internal); desktopPane.setSelectedFrame(internal); How I can lauch the

JDesktopPane resize

送分小仙女□ 提交于 2019-12-06 20:06:44
问题 We have a application with two JFrames with two JDesktopPanes. We need to move an internal frame from one frame to another. The problem we have is that after we move the internalframe from first window to the second window, when we resize the fist window, the internal frame of the second window also gets resized. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyVetoException; import javax.swing.JDesktopPane; import javax.swing.JFrame; import

How to change background color of jDesktopPane which is created usning tools in netbeans

痞子三分冷 提交于 2019-12-03 18:05:19
问题 By unsing netbeans ide , I created a JDesktopPane inside the JFrame . and I cannot change the color of the jdesktopPane.. I tried all I can. But when I open the JFrame .. the JDesktopPane inside that JFrame is in some blue color background. Please help me to change the background of JDesktopPane 回答1: I'm going to assume you're using GUI Builder with the default Nimbus look and feel (because you said you've tried everything, and I'll assume you've tried setBackground ). The look and feel has

JInternalFrame to front and focussed

元气小坏坏 提交于 2019-12-02 06:22:49
问题 How does one push a JInternalFrame to the top of all the frames in a JDesktopPane? 回答1: Read the JInternalFrame API and follow the link to the Swing tutorial on "How to Use Internal Frames" where you will find a working example of how to "select" the active internal frame. 回答2: try grabFocus() and requestFocus(). One of the should work. I personally used only requestFocus(). 回答3: In this example, a javax.swing.Action is used to select frames from a menu. 回答4: The OP has noted that setSelected

Scaling and zoom

南笙酒味 提交于 2019-12-02 00:50:17
问题 I need to implement zoom for a JDesktopPane contained in a JScrollPane . I have had prior success zooming by overriding the paintComponent(...) method and calling scale(double,double) . This is not working properly: the JInternalFrame 's and JPanel 's scale as intended, but the MouseListener 's for the JLabel 's and such register at the pre-scaled locations. What can I do? Thank you for reading. 回答1: ScaledPanel shows how to scale mouse coordinates using explicit transformation methods:

Scaling and zoom

爱⌒轻易说出口 提交于 2019-12-01 22:03:13
I need to implement zoom for a JDesktopPane contained in a JScrollPane . I have had prior success zooming by overriding the paintComponent(...) method and calling scale(double,double) . This is not working properly: the JInternalFrame 's and JPanel 's scale as intended, but the MouseListener 's for the JLabel 's and such register at the pre-scaled locations. What can I do? Thank you for reading. trashgod ScaledPanel shows how to scale mouse coordinates using explicit transformation methods: scaleX , scaleY , unScaleX and unScaleY . Alternatively, you can use an inverse transformation, as shown

Disable the Ctrl-Alt-Delete event through Java program

隐身守侯 提交于 2019-12-01 18:09:22
I am creating a desktop application using the JDesktopPane. I'm almost complete, but when I press ctrl + alt + del , it leaves my application. How can I prevent that action? Fact is Alt + Ctrl + Del never actually entering your application. Os traps Alt + Ctrl + Del before it is send to your application. So you can't trap it. sabbour Alt + Ctrl + Del cannot be overridden. It is a security feature. Itay Maman You cannot do that. The behavior of Alt + Ctrl + Del is enforced by the operating system, for good reasons: it makes sure that you can always bail-out of a faulty application. http://www

How do I open a JInternalFrame centered in a JDesktopPane?

孤街醉人 提交于 2019-11-30 20:33:13
I am adding a bunch of JInternalFrame s into a JDesktopPane , as the user selects to open various features through the menus. But I would like the internal frames to open centered in the desktop pane, as opposed to the upper left, where they seem to default. How can I specify that the JInternalFrames open centered, or move them to the center after opening? jDesktopPane.add(jInternalFrame); // jInternalFrame is not centered! For reference, here is the solution I used, based on dogbane's advice: Dimension desktopSize = desktopPane.getSize(); Dimension jInternalFrameSize = jInternalFrame.getSize(

Preventing JInternalFrame from being moved out of a JDesktopPane

此生再无相见时 提交于 2019-11-30 13:46:48
When I have a JInternalFrame in a JDesktopPane, the JInternalFrame is movable (which is good). However, it's possible to move it outside of the visible scope of the JDesktopPane (which I'm not so fond of) To see for yourself, here's some sample code: public static void main(String[] args) { JFrame frame = new JFrame("JDesktopPane"); JDesktopPane tableDisplay = new JDesktopPane(); JInternalFrame internalFrame = new JInternalFrame("JInternalFrame",true,true,true,true); internalFrame.setContentPane(new JLabel("Content")); internalFrame.pack(); internalFrame.setVisible(true); tableDisplay.add