Can you launch an Internal Frame by clicking a button

is it possible to launch an internal frame from clicking a button, instead of the menu system way?

You can instantiate an object of the JInternal frame in the actionperformed for the button.
also remember to say jinternal.setvisible(true) and also set bounds for the internalframe

Similar Messages

  • How to display internal frame on click event from another internal frame

    hi me developing desktop application in netbean. i have some problem. plz reply me as soon as possible. feedback me on [email protected]
    1. I want to invoke an Internal Frame by click event that is in another internal frame. how i do it. I tried my best
    2. how can i call reports (ireports) from swing application

    Read the JInternalFrame API. You will find a link to the Swing tutorial on "How to Use Internal Frames" which contains a working example.

  • Openinig internal frames by clicking menuitems

    Hi,
    I have been trying to open internal frames by clicking menu items but
    have not been able to do so because menuitems support only action listeners and not all mouse event listeners.
    Actually I wanted the event to return the frame n which the event has occured
    e.g., event,getframe(), so that I could create an internal frame in the same frame.
    But such kind of function is unavailable.
    Kindly suggest something...the code is given below (it works perfectly)..it need a text file from which the menuitems are read. This is also given below:
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.io.*;
    import javax.swing.plaf.metal.*;
    import javax.swing.*;
    import javax.swing.undo.*;
    class Action extends JFrame
         ActionListener FListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of File Menu was pressed.");}
        ActionListener EListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Edit Menu was pressed.");}
        ActionListener VListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of View Menu was pressed.");}
        ActionListener TListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Tools Menu was pressed.");}
        ActionListener HListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Help Menu was pressed.");}
         /*     protected class MyUndoableEditListener  implements UndoableEditListener
                  protected UndoManager undo = new UndoManager();
                  public void undoableEditHappened(UndoableEditEvent e)
                 //Remember the edit and update the menus
                 undo.addEdit(e.getEdit());
                 undoAction.updateUndoState();
                 redoAction.updateRedoState();
          class framecreator extends JFrame
               public JFrame CreateFrame(JMenuBar m)
             JDesktopPane jdp= new JDesktopPane();
              JFrame.setDefaultLookAndFeelDecorated(true);       
            JFrame frame = new JFrame("PEA");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         
            frame.setContentPane(jdp);
            jdp.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);          
            frame.setJMenuBar(m);       
            frame.pack();
            frame.setVisible(true);
            frame.setSize(600,600);
            frame.setLocation(100,100);
            return frame;
          class internalframecreator extends JFrame
             public JInternalFrame CreateInternalFrame(JFrame f)
              Container cp= f.getContentPane();
              JInternalFrame jif = new JInternalFrame("internal frame",true,true,true,true);
             cp.add(jif);
             jif.pack();
             jif.setVisible(true);
             jif.setSize(300,300);
             jif.setLocation(80,80);
             return jif;    
      class menucreator
         public String[] filereader()
              String[] menuitems=new String[21];
              int i=0,j=0;
              String record = null;            
                   for(int h=0;h<21;h++){ menuitems[h]=null;}
               try { 
                    FileReader fr = new FileReader("projectconfig2.txt");  
                     BufferedReader br = new BufferedReader(fr);
                         while ( (record=br.readLine()) != null )
                           StringTokenizer st = new StringTokenizer(record,"\n");
                             while (st.hasMoreTokens())
                          menuitems= st.nextToken();
         System.out.println(menuitems[i]);
    i++;
                   /* StringTokenizer st1 = new StringTokenizer(record,"\n");
         while (st1.hasMoreTokens())
         while ( (record=br.readLine()) != null )
         StringTokenizer st2 = new StringTokenizer(record,":");
         while (st2.hasMoreTokens())
         menuitems[i][j]= st2.nextToken();
         System.out.println(menuitems[i][j]);
              j++;      
         i++;
              } catch(IOException e)
         System.out.println("Error reading file");
         return (menuitems);
         public JMenuBar CreateMenu(Action a, String menuitems[])
    JMenuBar mb = new JMenuBar();
    JMenu fileB = new JMenu(menuitems[0]);
    JMenu editB = new JMenu(menuitems[8]);
    JMenu viewB = new JMenu(menuitems[11]);
    JMenu toolsB = new JMenu(menuitems[14]);
    JMenu helpB = new JMenu(menuitems[18]);
    mb.add(fileB);
    mb.add(editB);
    mb.add(viewB);
    mb.add(toolsB);
    mb.add(helpB);
    JMenuItem newpolicyB = new JMenuItem(menuitems[1]);
    newpolicyB.addActionListener(a.FListener);
    //newpolicyB.addUndoableEditListener(new MyUndoableEditListener());
    JMenuItem openB = new JMenuItem(menuitems[2]);
    openB.addActionListener(a.FListener);
    JMenuItem saveB = new JMenuItem(menuitems[3]);
    saveB.addActionListener(a.FListener);
    JMenuItem saveasB = new JMenuItem(menuitems[4]);
    saveasB.addActionListener(a.FListener);
    JMenuItem printxmlB = new JMenuItem(menuitems[5]);
    printxmlB.addActionListener(a.FListener);
    JMenuItem printreadablepolicyB = new JMenuItem(menuitems[6]);
    printreadablepolicyB.addActionListener(a.FListener);
    JMenuItem exitB = new JMenuItem(menuitems[7]);
    exitB.addActionListener(a.FListener);
    JMenuItem undoB = new JMenuItem(menuitems[9]);
    undoB.addActionListener(a.EListener);
    JMenuItem redoB = new JMenuItem(menuitems[10]);
    redoB.addActionListener(a.EListener);
    JMenuItem xmlB = new JMenuItem(menuitems[12]);
    xmlB.addActionListener(a.VListener);
    JMenuItem readablepolicyB = new JMenuItem(menuitems[13]);
    readablepolicyB.addActionListener(a.VListener);
    JMenuItem validateB = new JMenuItem(menuitems[15]);
    validateB.addActionListener(a.TListener);
    JMenuItem signandpublishB = new JMenuItem(menuitems[16]);
    signandpublishB.addActionListener(a.TListener);
    JMenuItem optionsB = new JMenuItem(menuitems[17]);
    optionsB.addActionListener(a.TListener);
    JMenuItem pemanualB = new JMenuItem(menuitems[19]);
    pemanualB.addActionListener(a.HListener);
    JMenuItem aboutB = new JMenuItem(menuitems[20]);
    aboutB.addActionListener(a.HListener);
    fileB.add(newpolicyB);
    fileB.add(openB);
    fileB.add(saveB);
    fileB.add(saveasB);
    fileB.add(printxmlB);
    fileB.add(printreadablepolicyB);
    fileB.add(exitB);
    editB.add(undoB);
    editB.add(redoB);
    viewB.add(xmlB);
    viewB.add(readablepolicyB);
    toolsB.add(validateB);
    toolsB.add(signandpublishB);
    toolsB.add(optionsB);
    helpB.add(pemanualB);
    helpB.add(aboutB);
    mb.setSize(300,200);
    mb.setVisible(true);
    return mb;
    public class project
    public static void main(String args[])
              Action a =new Action();           
              framecreator fc=new framecreator();           
         menucreator mc=new menucreator();     
         internalframecreator ifc= new internalframecreator();          
         ifc.CreateInternalFrame(fc.CreateFrame(mc.CreateMenu(a,mc.filereader())));
    The text file called projectconfig2.txt
    File
    New Policy
    Open...
    Save
    Save As...
    Print XML
    Print Readable Policy
    Exit
    Edit
    Undo
    Redo
    View
    XML
    Readable Policy
    Tools
    Validate
    Sign & Publish
    Options
    Help
    PE Manual
    About

    The problem is that you are adding the JInternalFrame to the JFrame's contentPane when it should be added to the JDesktopPane. See your code ...
    public JInternalFrame CreateInternalFrame( JFrame  f )
         Container  cp = f.getContentPane();
         JInternalFrame jif = new JInternalFrame("internal frame",true,true,true,true);
         cp.add( jif );

  • Can you lower the sound of the "click" when sliding to unlock?

    Can you lower the sound of the "click" when sliding to unlock?

    Settings>Sounds>Lock Sounds>On/Off.
    Doesn't lower it, though. Just turns it off or on.

  • Can you launch and close a Microsoft Word file from Captivate 8.01?

    Can you launch and close a Microsoft Word Document from inside your Captivate 8.01 project?
    Thank you, L

    You can launch it as long as the server has the mime/type, especially if a docx.
    Doubt that you can close it.

  • How can we enable tick icon when user click any button

    how can we enable tick icon when user click any button in captivate 6@

    hi first of all thanks for imitate action.
    actually i want to make a menu (TOC) with tick icons, on starting all ticks are disabled but when i click on any button from my menu i want to enable tick for that particular button so that user can know easily the visited button.

  • Can you still get internal HDs for the G4 PB 12"?

    I still use my trusty 12" Powerbook G4 for my hobby of freelance writing and photography. Indeed, the ONLY thing currently 'wrong' wih it - for what I need from it these days - is that the internal 40Gb hard drive is now way to small for all the stuff I want to keep on it.
    Is it still possible to get compatible internal hard drives for it? If I can get a 500Gb internal hard drive, it'll save me the expense of having to buy a whole new laptop. Which seems a bit silly as the Powerbook G4 is still more than adequate in every other way!
    (I know I could get an external drive, but an internal one woould be a whole lot better!)
    Can anybody help, please?

    Robin:
    As noted, yes, PATA drives are still available for your computer. Here is a list of available drives for your computer at OWC. You do have a lot of tiny screws to deal with, but it can be managed. The most troublesome are two tiny screws on each side of the case. Be very careful not to damage the heads of the screws. You will also discover that the 1.5 GHz version does not have an EMI finger to be removed, as noted in the step by step directions. In addition to the step by step directions from iFixit here are few tips you may find helpful:
    • Print out the ifixit directions as well as the screw guide ahead of time.
    • Be sure you have the right tools. You don't want to damage the screw heads or you may never get them out. And the Torx screw driver is critical. For a spudge I use the handle of an old toothbrush (choose one made of hard plastic), cut off the brush and bevelled the handle end like a flat blade screw driver). For some spudge jobs a credit card will do the trick.
    • Picking up on one user’s suggestion, I clicked on the pages of each step which involved removing screws to enlarge, then printed out the pages. I poked holes in the paper where the screws were removed, poked the screws in the holes and stacked the pages in order in which the screws were removed. Reassembling was a lot easier. No cups to tip over and spill. No guessing. Each screw was exactly in the right place. You can use an ice cube tray, egg carton, dixie cups etc. I previously used small medicine cups one for the screws in each step. I nested them so that the last ones out and the first to go back in are on top. (Some users report cutting up the screw guide and placing the applicable section in each container.)
    • Be very careful pulling out leads. Hold the lead as close to the plug as possible and wiggle (the plug ) to loosen its grip. Don’t hold the wires and pull as that can damage the cable, or worse, in some instances pull the wires out of the plug. Indeed, some users have pulled the socket off the logic board! Use needle nose pliers or tweezers if you can access the plug, or nudge the plug with a small instrument to help loosen its grip.
    • Use force gently in removing parts. Separating upper and lower case takes some doing. Use a plastic tool (spudge) so as not to mar the case.
    • Refer to the screw guide when reassembling computer. Putting longer screws in the wrong place can perforate the circuit board.
    Please do post back with further questions or comments.
    cornelius

  • Can you launch a doc in Pages 5 with the formal panel closed?

    Driving me nuts, there's a number of Pages 5 documents that don't need to have anything but text edited and I don't need that side format box/panel to be open, which in smaller screens really uses up a lot of space.
    Is there a way to open a document with that darn side panel closed?

    Actually I have just tested Pages 5 and yes you can turn off the side panel by clicking on the Format icon (Paintbrush) top right.
    However since 95% of all your styling is only visible there, you will be turning it on and off a lot.
    You used to be able to show and hide the Inspectors with a keyboard shortcut in Pages '09, so that will still be your best option on your laptop.
    You raise a very valid point about the actual useability of the new UI.
    I disagree with the new User Interface for other reasons, principally it does such a poor job of showing the correct settings for users as needed, this just makes it one more reason to give it an F.
    Peter

  • Can you take a photo by using the volume button on iPad 2

    Can you take a photo or video by using the up volume button on iPad 2?

    Just double-checked the manual and yes you can take photos and videos using the up volume button - I missed it when I checked it earlier

  • Can you Launch External Applications From Within InDesign Ebook?

    Hi all,
    I was wondering if it is possible to open an external application from within an ebook (created with InDesign) e.g. click on a link and have an external ssh client open up for instance?
    Thanks in advance for any advice.
    Regards,
    RG

    It's possible to include hyperlinks in an InDesign file and export them in an EPUB file. Since I'm not familiar with working with SSH clients (in fact, I just had to Google it to have a clue what you're talking about), is this something that can be invoked in a standard URL format? If so, you could probably include it.
    The next issue is whether the link would work. The link couldn't be used directly in any eBook reader I know of, but at least the iBook on an iPad or iPhone would switch to to Safari to let you follow a URL to its destination. But I don't think that's possible on most eBooks.

  • Can you Choose a Particular Frame for Quicktime Icon Preview?

    Is it possible to choose a specific frame for a Quicktime file icon preview? A lot of movies start out with a black frame and the icon preview in Finder is therefore a black square. I would like to be able to choose the frame to use for the preview.

    Badunit wrote:
    Is it possible to choose a specific frame for a Quicktime file icon preview? A lot of movies start out with a black frame and the icon preview in Finder is therefore a black square. I would like to be able to choose the frame to use for the preview.
    I don't know if this is possible (ask in the QT forum) but you can trim the movie with QT player to get rid of the black frame at the beginning of the movie. you can also take a screenshot of any frame you want and apply it as a custom icon to the movie.

  • HT2307 How can you shut off the option command click shortcut that minimizes all windows?

    I can't find a place to turn off the option click shortcut that minimizes the last window and option command click that minimizes all of the other windows. Is there a way to do this? They don't show up (or I can't find them) in the Dock Preferences or the Keyboard Shortcuts.

    I use Photoshop, Illustrator and InDesign and that's the zoom shortcut keys with space. If I use another program on my second monitor and go back to that and want to zoom in it minimizes everything else.
    Why reply if you don't know?

  • Can you turn off the Sleep/Wake "click" noise on an iPhone 5C?

    Is there a way to turn off or change the "click" noise when activating the sleep mode on an iPhone 5C as it can be distracting and/or annoying?
    I am running the current iOS (8.1.3) and iTunes.

    Yes. It's under Settings/Sounds/Lock Sounds (you'll have to scroll all the way down to the bottom of the page to see the setting). Disable/turn off "Lock Sounds" and you should be all set.

  • First Script: Need some basic skill help? Can you add an image with a click?

    Hello, Im working on a project were you can replace people heads in a photo. Its for a project so its not supposed to be perfect. So far heres what i think the best steps to take are, but im not sure how to take the first scripting steps. How can i add an image with a script? How can i store a x y coordinates?
    1. I would create four variables and than store the XY cords of the the high point of the head, the bottom of the chin, amd the farthest right and left of the face.
    2. I would than add the image of the head that I would already have.
    3. If the x coordinates of the top and bottom are off kilter, I would rotate new head until = old face dimensions..
    4. I would also see if the width is too big or small and resize accordingly
    5. I would than resize the head so that the eyes would match up.
    Thanks for any help you can provide!

    Is that script for a browser html. Its not for Photoshop and like Photoshop would fine UiApp undefined so does Microsoft.  Is that a Chrome script or Android script? Why post it here?
    Atiqur Sumon wrote:
    function doGet() {
       var app = UiApp.createApplication();
       // The very first Google Doodle!
       app.add(app.createImage("http://www.google.com/logos/googleburn.jpg"));
       // Just the man in the middle
       app.add(app.createImage("http://www.google.com/logos/googleburn.jpg", 118, 0, 50, 106));
       return app;

  • Can you monitor signals using frame api on a PDA?

    Hi all
    I'm pretty new to LV all together, but I'm working on writing a program to monitor information off our CAN network, like oil pump speed, water temp, batt voltage, etc.  Is there a way to monitor these signals using the frame api, opposed to channel api, and display them continuously on a gauge/meter?  Since I'm using PDA module, I have to use the frame api, and not channel.  Frame api seems a little more vague to me than channel api.  Any advice or tips are welcome.
    Also on a side note, I copied/pasted a tab that i changed the background color to yellow from a windows targeted program to a PocketPC one.  The tabs stayed yellow when I built and transfered the .exe to the pda, but i don't have any control now on its color because PDA module doesn't have Property Nodes.  Every now and then, the tabs will go to default grey, and i have to undo the changes to get it back to yellow.  Is there some way to control the color?  I don't think the Change Control Color works in this case.
    Thanks ahead for any comments and advice.

    ....By the way, i'm using a PCMCIA-CAN/2 (HS) card on a PDA running WinCE5.0 and soon to be one running WinCE4.2...

Maybe you are looking for