I want to open only one JInternalFrame

How do I control the MainGUI (JDeskTopPane) to open only ONE listenInputWindow (JInternalFrame)? There is my wrony code, but I do not know how to correct. I can open another listenInputWindow even one is already on Desktop.
public class MainGUI extends javax.swing.JFrame {
InputMenuFrame listenInputWindow;
/** Creates new form MainGUI */
public MainGUI() {
initComponents(); //Method to create the MainGUI
private void inputMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
if (listenInputWindow == null) { //suppose this line to control the opening
InputMenuFrame listenInputWindow = new InputMenuFrame();
listenInputWindow.setLocation(600, 0);
listenInputWindow.setVisible(true);
desktopPane.add(listenInputWindow);
}

Great :)
Please try to be more specific - generally you do not want to have your GUI driven by embedded code.
Consider structuring your app to use the GUI to trigger events in Observerable objects.... this does a number of things, prevents write/paint lockups, permits changing the GUI without affecting the underlying code and vice versa....
If you could provide more detail as to what you need perhaps I could offer a couple of hints...

Similar Messages

  • Safari dont want to open only one (my own) website, the post connected to this site cant download any emails

    Sorry for my english.
    I have my own website (can tell you the name, if you ask). In December after I have installed 5.0.1 my website and the post doesnt work via 3g, gprs.
    With wi-fi everething is ok. In opera via 3g, gprs, wi-fi everething is ok.
    thank you

    Dear Forum viewers,
    With lots of digging and faffing around I have discovered what the problem was.
    A supposedly benign programme that had been running in the background for years,was the culprit.
    It took some finding, it is a complete b4st4rd!
    Uninstall 'Peerguardian' whatever you do.
    Problem solved.
    Cheers,
    Chris

  • Open only one frame

    Hi, I want to open a frame when I run an application. The problem is that that frame is opened always that I run the application, so you can have several opened frames.
    How can I make to open only one frame, and that no frame is opened until I close the first one?
    thanks

    This is with useing a button
    first class
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class ball extends JFrame implements ActionListener{
      ballball bebe = new ballball();
      public ball() {
      super("My button");
      setSize(400,400);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      Container pane = getContentPane();
      FlowLayout flow = new FlowLayout();
      pane.setLayout(flow);
       pane.add(bebe.button);
      bebe.button.addActionListener(this);
      setContentPane(pane);
      setVisible(true);
      public void actionPerformed(ActionEvent me){
       Object ob = me.getSource();
       if(ob == bebe.button) {
         bebe.Myothergui();
         bebe.button.setEnabled(false);
    public static void main(String[] args) {
         ball ba = new ball();
    Second class
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class ballball {
       JFrame frame;
       JButton button = new JButton("my butto");
    public void Myothergui() {
       frame = new JFrame();
      frame.setSize(300,300);
      frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                     button.setEnabled(true);
                    frame.setVisible(false);
       frame.setVisible(true);
    GOOD LUCK and learn to use the http://java.sun.com/j2se/1.4/docs/api/ most of your ? can be answered there.Anyways have a good one and STUDY STUDY STUDY

  • Instead of creating multiple Instances I want to create only one Instance.

    Hi Everyone
    Good morning, How are you.
    I have a requirement to transfer files from one location to another location, I am able to do this successfully using FTP Adapters.
    I have some Issues please help any one.
    1) When I deployed my process it is creating one instance for one file transfer, Suppose If I have 50 files in my Get
    directory, After deploy the process 50 instances are creating and 50 Email generating saying files are not tranfered successfully.
    Instead of creating 50 Instances I want to create only one Instance.
    2) When files are not transferd it will fire error mail saying that not success (I want to display all file names(not tranfered files) in my mail , i.e whatever files are not tranfered, need to diplay in mail).
    3) And I am not able to transfer 0 size files, But in BPEL Console Instance is creating for 0 size file also and I am getting Email for success... and In put directory 0 size file is not showing. (Instance is creating and Success Email coming but file is not exists in Put directory)
    Please help me.
    Regards
    Venkat
    Edited by: user10263255 on Oct 1, 2008 8:10 AM
    Edited by: user10263255 on Oct 1, 2008 9:15 AM

    Hi Dharmendra,
    Thanks for your reply.
    I am not able to see any thing about singleton process in mentioned URL.
    Can you please provide me the another URL or please paste here about singleton process .
    Thanks in Advance.
    Regards
    Venkat

  • I want to make only one node draggable in the tree. How?

    I want to make only one node draggable in the tree. How?
    when we have only
    tree.setDragEnable(true)which makes draggable the entire nodes in the tree.
    Thanks -

    Hi Andrea
    Just to clarify things up: is this what you want?
    package treeDnD;
    * DragJustOneNode.java
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class DragJustOneNode extends JFrame {
        private JTree tree;
        private DefaultTreeModel model;
        private DefaultMutableTreeNode root;
        public DragJustOneNode() {
            super("Only child 1 is draggable!");
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setSize(400,300);
            setLocationRelativeTo(null);
            tree = new JTree();
            tree.setDragEnabled(true);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
            tree.setTransferHandler(new TreeTransferHandler());
            root = new DefaultMutableTreeNode(new NodeData(0, "root"));
            root.add(new DefaultMutableTreeNode(new NodeData(1, "child 1")));
            root.add(new DefaultMutableTreeNode(new NodeData(2, "child 2")));
            root.add(new DefaultMutableTreeNode(new NodeData(3, "child 3")));
            root.add(new DefaultMutableTreeNode(new NodeData(4, "child 4")));
            model = new DefaultTreeModel(root);
            tree.setModel(model);
        public static void main(final String args[]) {new DragJustOneNode().setVisible(true);}
    class NodeData{
        private int id;
        private String data;
        public NodeData(final int id, final String data){
            this.id = id;
            this.data = data;
        public int getId() {return id;}
        public void setId(final int id) {this.id = id;}
        public String getData() {return data;}
        public void setData(final String data) {this.data = data;}
        public String toString() {return data;}
    class TreeTransferable implements Transferable{
        private NodeData nodeData;
        public TreeTransferable(NodeData nodeData){
            this.nodeData = nodeData;
        public DataFlavor[] getTransferDataFlavors() {
            return new DataFlavor[]{DataFlavor.stringFlavor};
        public boolean isDataFlavorSupported(DataFlavor flavor) {
            return true;
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
            return nodeData;
    class TreeTransferHandler extends TransferHandler{
        private DefaultMutableTreeNode sourceNode, targetNode;
        public boolean canImport(final JComponent comp, final DataFlavor[] transferFlavors) {
            NodeData nodeData = (NodeData) (sourceNode).getUserObject();
            if(nodeData.getId() == 1) return true;
            return false;
        protected Transferable createTransferable(final JComponent c) {
            JTree tree = ((JTree)c);
            sourceNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
            return new TreeTransferable((NodeData) sourceNode.getUserObject());
        public int getSourceActions(final JComponent c) {return DnDConstants.ACTION_MOVE;}
        public boolean importData(final JComponent comp, final Transferable t) {
            JTree tree = ((JTree)comp);
            DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
            targetNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
            DefaultMutableTreeNode parent = (DefaultMutableTreeNode)targetNode.getParent();
            if(parent == null) return false;
            model.removeNodeFromParent(sourceNode);
            model.insertNodeInto(sourceNode, parent, parent.getIndex(targetNode));
            tree.setSelectionPath(new TreePath(model.getPathToRoot(sourceNode)));
            return true;
    }

  • Help--How can I open only one java program at one time?

    How can I open only one java program(same program) in Windows at one time?

    In Java 1.5, you can use the JVM's own monitoring APIs to examine what other JVMs are running on the system, and what applications they're running.
    It's general and powerful, but complex. The socket/file/whatever approach is cleaner, and probably more suited to your usage.
    Don't bother trying to use the Windows task manager for this sort of thing. You have to write messy native code, and it isn't reliable after all that anyway.

  • Suddenly I can open only one Firefox window at a time. I can have multiple tabs in that window, but I can suddenly no longer open another window. What happened?

    Suddenly I can open only one Firefox window at a time. I can have multiple tabs in that window, but I can suddenly no longer open another window. What happened?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Browser will open once and open only one page. It closes but then won't open again. How do i fix it?

    In the last 24 hours my browser will open only once and go to only one site i choose. after that , i can go to another site but links won't open or anything else. After i close the browser , so i can restart it, it tells me firefox is already open. Problem is it never shuts down in the background. I have to use the task manager to shut it off so i can open it again. Funny thing is that internet explorer, works fine but i don't want to use it. I even tried reinstalling firefox but it did not work. I had to post this on a different computer as well.

    https://support.mozilla.com/en-US/kb/Firefox%20hangs#w_hang-at-exit

  • I don't want to import PHOTOS. I want to get only one into Lightroom for temporary work. How do I do this. (the photo is now in Photoshop Elements).

    Don't want to import all photos from my camera or anywhere else. I only want to work on one image then put it back into Elements. Please tell me how to do this and I would appreciate a detailed answer. Please do not be vague.

    Lightroom is not a file browser, It isn't anything like the organizer in Photoshop Elements. Lightroom uses a catalog, which is a database. That database keeps track of the location of images that have been imported, as well as all of the adjustments that you make to those images using Lightroom. The import process is a process of showing Lightroom where the images are located on your computer. You can't just open an image in Lightroom, make changes and then close it. Lightroom doesn't make changes to the original image. Your images are left in their pristine state. All the changes are stored in the catalog. And when it comes time to share an image that has been adjusted in Lightroom you need to export a copy that includes all of those changes. It's a different workflow, and one that you need to become accustomed to. I suggest that you watch a series of short tutorials that will help you understand more completely how Lightroom works.
    Getting Started with Adobe Photoshop Lightroom 5 | Adobe TV

  • When I click on the icon to open Firefox I get an error message " A copy of Firefox is already open, only one copy of Firefox can be open at a time".

    I have tried to download and run Firefox on my MAC OS 10.6.7 several times and have run into this error message every time:
    "A copy of Firefox is already open. Only one copy of Firefox can be open at a time". A search through the computer does not fine another copy of Firefox and there is no window open or evidence of the program open.
    When I got this computer a year ago I copied the hard drive from the old computer onto the new and the old computer had a copy of Firefox on it and the program worked on that computer. It would not run on the new computer so I thought maybe it was due to the Intel chip so I deleted the program and downloaded the newest version at the time. This is when I started getting the error message and subsequent attempts have yielded the same results.
    Can you be of help?

    See:
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • How to open only one clip at a time in the source monitor?

    Ok the answer to this question may be simple.. hopefully...
    At the moment each time I open a clip in the source monitor it adds it to the dropdown list.
    Fine... but I am opening and closing hundreds of clips in a day and after a while I noticed it seemed to be slowing down the whole PPCS5.5 system.
    It appears that PP seems to be keeping each clip I open... active.
    Is there a way to allow only one clip to be open at a time in the source monitor... other than having to close them all first??? (would be ideal if there was some kind of shortcut like shift-doubleclick)

    SonyZ7's can record to compact flash cards as well as tape, so I generally log and transfer from the cards.
    So I guess I should do a bit more research on workflow's in Pr
    No probs, here's a bunch of MediaInfo...
    General
    Complete name                            : /Volumes/Rugged 1TB/Business/WAPLES 10.October/Check It 2011 Event/Check It 2011 event footage/001 CheckIt2011.mov
    Format                                   : MPEG-4
    Format profile                           : QuickTime
    Codec ID                                 : qt 
    File size                                : 195 MiB
    Duration                                 : 1mn 0s
    Overall bit rate                         : 26.9 Mbps
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-10-28 11:50:04
    Writing library                          : Apple QuickTime
    Original source medium                   : Check It event CF2
    ©TSC                                     : 2500
    ©TSZ                                     : 100
    Video
    ID                                       : 1
    Format                                   : DV
    Codec ID                                 : hdv3
    Duration                                 : 1mn 0s
    Bit rate                                 : 25.0 Mbps
    Width                                    : 1 416 pixels
    Original width                           : 1 440 pixels
    Height                                   : 1 062 pixels
    Original height                          : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:2
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.665
    Stream size                              : 181 MiB (93%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 192330610
    Material_FrameCount                      : 1539
    Audio #1
    ID                                       : 2
    Format                                   : PCM
    Format settings, Endianness              : Little
    Format settings, Sign                    : Signed
    Codec ID                                 : sowt
    Duration                                 : 1mn 0s
    Bit rate mode                            : Constant
    Bit rate                                 : 768 Kbps
    Channel(s)                               : 1 channel
    Channel positions                        : Front: L
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Stream size                              : 5.57 MiB (3%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 5909760
    Audio #2
    ID                                       : 3
    Format                                   : PCM
    Format settings, Endianness              : Little
    Format settings, Sign                    : Signed
    Codec ID                                 : sowt
    Duration                                 : 1mn 0s
    Bit rate mode                            : Constant
    Bit rate                                 : 768 Kbps
    Channel(s)                               : 1 channel
    Channel positions                        : Front: R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Stream size                              : 5.57 MiB (3%)
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37
    Material_Duration                        : 61560
    Material_StreamSize                      : 5909760
    Menu
    ID                                       : 4
    Language                                 : English
    Encoded date                             : UTC 2011-09-08 21:37:37
    Tagged date                              : UTC 2011-09-08 21:37:37

  • How can I unsplit my mozilla screen? I want to see only one screen at a time!

    When I open mozilla only one screen shows up. Then when I open another website from my bookmarks mozilla all of the sudden split the screen into one website and then icloud. Very frustrating. Any help would be appreciated.

    I've called the big guys to help you. Good luck.
    In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

  • Error on Mac- A copy of firefox is already open. only one copy of firefox can be open at a time.

    error message on mac - a copy of firefox is already open. Only one copy of firefox can be open at a time.

    This worked, I used the method described in this link http://forums.mozillazine.org/viewtopic.php?t=365156, and opened the Mozilla profile screen with the terminal on my mac, using the language given in the links. Then I duplicated my original profile to save the bookmarks, etc. Put them in a folder listed Duplicate profile with the date. With the open profile screen, I deleted my original profile, created new profile folder and then a new profile. Note that profile cannot be created in the system library, it must be created on the disc, because the library will not allow writing into it. After I created my new profile folder, I dragged all my old information into it, and it worked. Firefox closed and the error disappeared. You must be VERY careful to make sure Firefox is closed anytime you are doing anything with the profile folders. I think that is what caused my original problem.

  • How to open only one web page at a time?

    I used to have it set so when I opened a new web page, the previous one closed. Now, nothing closes automatically and I have about 50 pages open that I have to close. How do I set it so that only one page opens at a time?

    HI Janice,
    You can use a keyboard shortcut to close all windows in Safari. CommandShiftW.
    To close one window, Command + W.
    Carolyn

  • Sometimes I just want to close ONLY one window, but Firefox is closing ALL TABS, and I don't want this!

    I sometimes will open several windows, especially from my Comcast mailbox. When I am through with that window, I will close it, but leave the other ones open. FIrefox won't do this any more, When I close 1 window, Firefox send me a message stating that it is CLOSING ALL TABS. I DONT WANT TO CLOSE all of them, I just want to close the window I am closing!. This is very annoying, because I have to re-log back into everything, because FIrefox is "CLOSING ALL TABS", and all I want to to close ONE window...I am about ready to chuck this browser....I tried to find an answer to this in tools, but was unable to do so. Please help me with this

    Use CTRL+W - to close the surrent tab.
    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select anything right now, just use "'Start in Safe Mode"''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

Maybe you are looking for

  • I have an iPad 2 and i want to update it to the iOS 7 but i dont see the software update, i have 6.1

    i've tryed everything, i went to the settings to browse for a new uptade but didnt find anything, i also try in my computer clicking on chek for uptade, what do i do?

  • Multiple Fonts in a javax.swing.JTextPane

    I am trying to use multiple fonts in a JTextPane, but can only find ways of changing the font family used. Can anyone give me any pointers on how to do this, or a document somewhere that explains, either way with out going into the javax.swing.text.h

  • EEWB (attributes from product set type)

    Hi gurus, I have a question about EEWB. Could you please help me. There is possibility to add components (attributes from product set type) at item level: Business object - BUSINESS_TRANSACTION Extension Type - ADD_NEW_ITEM_COMPONENT. I’ve created an

  • Reentrance in ansynchronously called Vis

    Hi all, Recently I've developed an application that heavily utilizes a single GPIB communication SubVI, which writes a query and reads answers from a single device. In order to avoid collisions, I have deliberately set this VI as non-reentrant. This

  • Cleaning cookies ? Some of my old pictures are missing ?

    Hello, I feel that my iMac is suddenly slow. I have heard that cleaning up the cookies would help. So not knowing how to do it, I went to History and click on "Clear History" thinking it would works its magic. Some of my old pictures are now missing