Multiple Frames  - JInternalFrame

Goal:
I need to create a main window. This window contains multiple different views.
( I should be able to switch back and forth among these views).
Each view contains 4 small frames/window.
My design thought:
Step 1. Main window = JFrame.
Step 2.Using JLayeredPane to add several layers onto JFrame in z order. Each layer=one view.
Step 3. Each layer of step 2 should be able to hold 4 frames/windows.
Problem:
In step 2, JLayeredPane can only hold JInternalPane or Jpanel. JLayerPane can't hold JFrame.
Therefore , I can't do step 3 because JInternalFrame from step 2 can't hold any more frames.
Where I am wrong? Or it is just impossible to do such thing?

* Card_Layout_Demo_2.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Card_Layout_Demo_2 extends JFrame {
    public Card_Layout_Demo_2() {
        initComponents();
    private void initComponents() {
        cards = new JPanel();
        jDesktopPane1 = new JDesktopPane();
        jInternalFrame1 = new JInternalFrame();
        jDesktopPane2 = new JDesktopPane();
        jInternalFrame2 = new JInternalFrame();
        jDesktopPane3 = new JDesktopPane();
        jInternalFrame3 = new JInternalFrame();
        jToolBar1 = new JToolBar();
        jButton1 = new JButton();
        jButton2 = new JButton();
        jButton3 = new JButton();
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setTitle("Card Layout Demo 2");
        cards.setLayout(new CardLayout());
        jInternalFrame1.setTitle("Frame 1.1");
        jInternalFrame1.setPreferredSize(new Dimension(200, 100));
        jInternalFrame1.setVisible(true);
        jInternalFrame1.setBounds(0, 0, 200, 100);
        jDesktopPane1.add(jInternalFrame1, JLayeredPane.DEFAULT_LAYER);
        cards.add(jDesktopPane1, "panel 1");
        jInternalFrame2.setTitle("Frame 2.1");
        jInternalFrame2.setPreferredSize(new Dimension(200, 100));
        jInternalFrame2.setVisible(true);
        jInternalFrame2.setBounds(0, 0, 200, 100);
        jDesktopPane2.add(jInternalFrame2, JLayeredPane.DEFAULT_LAYER);
        cards.add(jDesktopPane2, "panel 2");
        jInternalFrame3.setTitle("Frame 3.1");
        jInternalFrame3.setPreferredSize(new Dimension(200, 100));
        jInternalFrame3.setVisible(true);
        jInternalFrame3.setBounds(0, 0, 200, 100);
        jDesktopPane3.add(jInternalFrame3, JLayeredPane.DEFAULT_LAYER);
        cards.add(jDesktopPane3, "panel 3");
        getContentPane().add(cards, BorderLayout.CENTER);
        jButton1.setText("Panel 1");
        jButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton1ActionPerformed(evt);
        jToolBar1.add(jButton1);
        jButton2.setText("Panel 2");
        jButton2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton2ActionPerformed(evt);
        jToolBar1.add(jButton2);
        jButton3.setText("Panel 3");
        jButton3.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jButton3ActionPerformed(evt);
        jToolBar1.add(jButton3);
        getContentPane().add(jToolBar1, BorderLayout.NORTH);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
    private void jButton1ActionPerformed(ActionEvent evt) {
        CardLayout cl = (CardLayout)cards.getLayout() ;
        cl.show(cards, "panel 1");
    private void jButton2ActionPerformed(ActionEvent evt) {
        CardLayout cl = (CardLayout)cards.getLayout() ;
        cl.show(cards, "panel 2");
    private void jButton3ActionPerformed(ActionEvent evt) {
        CardLayout cl = (CardLayout)cards.getLayout() ;
        cl.show(cards, "panel 3");
    public static void main(String args[]) {
        new Card_Layout_Demo_2().setVisible(true);
    private JPanel cards;
    private JButton jButton1;
    private JButton jButton2;
    private JButton jButton3;
    private JDesktopPane jDesktopPane1;
    private JDesktopPane jDesktopPane2;
    private JDesktopPane jDesktopPane3;
    private JInternalFrame jInternalFrame1;
    private JInternalFrame jInternalFrame2;
    private JInternalFrame jInternalFrame3;
    private JToolBar jToolBar1;
}

Similar Messages

  • Multiple Frames

    Does anyone have a simple procedure for incorporating
    multiple frames in an app, not JInternalFrame, just muliple frames
    like in VB me.hide, me.show

    Frames have a setVisible(boolean) method.
    You can just do frame.setVisible(false) to make a frame invisible.
    So to have multiple frames simply make the frames, only set one to visible (with .show()), from there you can make your frames visible or not visible with the .setVisible(boolean) method.

  • I'm trying to print multiple frames from a website onto separate pages.

    Firefox has this option on OSX (each frame on separate page), but safari seems to lack such an option.
    I need to print multiple frames (invoices from zencart) each on separate pages. When I try to print with Safari it will either try and print the selected frame, or it will print all the frames as it's laid out on the page (all printed on one page). Am I missing this option somewhere? Is there an extension I can try (already tried print plus to no avail)?
    Thanks for all the help!

    Wasn't aware of that, I'm trying to disable Full Screen completely in all Apps on my Lion.

  • How to use TextFormat on multiple frames

    I must be missing something, but how on earth do I make it so
    that I can set TextFormats for the whole movie and not just the
    frame the actionscript is on.
    My movie is basically a video with cuepoints that trigger
    different keyframes that display text appropriate to what the
    person featured in the video is talking about. In other words it's
    like a powerpoint presentation that's run by an FLV file. Almost
    all of the blocks of text I'll be displaying are bulleted lists and
    since, for some odd reason, bulleted lists aren't available using
    the standard Flash GUI text formating tools I need to apply them
    via ActionScript. All the ActionScript is in its own keyframe at
    the beginning of the movie timeline. I've setup my text formating
    code like this:
    var bulletlist:TextFormat = new TextFormat();
    bulletlist.bullet = true;
    bulletlist_field.setTextFormat(bulletlist);
    While I have successfully applied this to a box of text on
    the first frame of the movie, I haven't be able to apply it to text
    on any other keyframe. So from what I can tell, I have to reference
    the above TextFormat actionscript for every frame I need to use it
    on, and since I can't have duplicate TextFormat values, that means
    I'd have to create a new instance with a new name for each frame.
    This seems rather inefficient and frankly ridiculous consider that
    the other ActionScript that I wrote seems to apply to the whole
    movie. And what's the point of using ActionScript to format text if
    you have to redo it for every *******' keyframe? Is there some
    function that I'm missing somewhere to allow me to use one set of
    TextFormat code on multiple frames or is this simply a dysfunction
    of Flash and/or ActionScript 3.
    Any help would be appreciated.

    Craig Grummitt - Why so it is. Thanks for pointing that out.
    But my point still remains: You can change the defaultTextFormat
    property before you assign the text property or you can use
    setTextFormat() after you have assigned the text property. That one
    is a property and the other is a method just makes it more likely
    that somebody will over look one or the other!
    fallenturtle - part of the issue is that really great
    typographic stuff is tough and most people can't even use the
    simple tools that we have. For use with CS4 and Flash 10 publishing
    they are coming out with a far more complex Text Layout Framework.
    As best I can tell it is insanely complex and I'm guessing most
    people will never use it....but who knows.
    Additionally you are trying to do one of the more difficult
    things: mix timeline with code. That always gets tricky. If you
    were just using code you could create one textformat instance and
    apply it to all your code-created text fields. But since each
    timeline created clip is a new one you will need to apply the
    formatting by hand.
    Or you could just have one timeline created text field that
    went across all your frames and then change its properties with
    code everytime you needed to change it.

  • Trouble with editing multiple frames

    Hi guys,
    I'm new to CS4 - learnt my flash many years ago on Flash 5. So anyway I'm trying to get used to the new Motion Tween function and having a few problems.
    I've created a simple animation where an object fades in, stays put for a moment and then fades out (one motion tween with 4 keyframes). I now want to resize the movie clip across all of these keyframes cos I got it wrong to start with.
    So I click 'Edit Multiple Frames' (everything disappears but that's for another question), drag the onion thingy across the timeline and select the frames on the layer I want to edit. I then click on the free transform tool and drag the invisible movie clip (you can see the outline!) to make it larger.
    Result? Well it seems to scale the first frame, but the others are all left at the original scale. Hence animation now shows object fading in whilst getting smaller etc. etc.
    There must be an easy way to do this. I've tried the motion editor but you have to do it keyframe by keyframe. Any suggestions?
    Thanks
    Ben

    Modifying an entire animation with motion tweens is not as easy as it used to be.
    Here's the best answer you are probably going to get.
    from : http://flashthusiast.com/2009/10/06/scaling-and-moving-new-motion-tweens-in-flash-cs4/
    Scaling an entire animation that does have Scale X or Scale Y animated.
    If you have previously scaled anything in the tween, doing this is applied to the first keyframe and the tween would animate to the earlier scaling (the auto-keyframing feature can be a detriment in this situation, especially when it comes to scaling due to the percentages being reset - for this reason Motion Presets also won’t help). In this situation, I recommend scaling using the Motion editor:
    1. Go to the Scale X and Y properties in the Motion Editor.
    2. Press the Alt key while dragging the curve in each graph up and down. This scales the entire scale animation at the same time (same as edit multiple keyframes).
    3. If you need to proportionally scale the motion path for the tween as well, select the path on the Stage and use Free Transform or enter a new value in the Transform panel.
    I have had success with the above method, but from what I can tell you can only do one property at a time on one object at a time. So it is an awful amount of work.
    As for step 2: while dragging the whole curve it seems the property value is very reluctant to snap to whole integers and I often see values like 200.35%.
    Same thing applies for dragging property keyframes up and down in the motion editor. Is there a way to get nice clean numbers? I I want to scale something by 50% I don't want 49.83% I find myself often keying in these values by hand.
    For me even though scale X and scale Y are "linked / locked / contstrained" It seems I get mixed results with this feature. Changing scaleX doesn't always change scaleY

  • Error with Render Multiple Frames

    I have this problem before and the only solution I had was to reinstall the WHOLE system and it was fixed that way (but manually install Adobe CC).
    The problem is the next:
    After Effects doesn't render anything if I have "Render Multiple Frames Simultaneously" enabled. If click "Render" and it keep there forever and it never render, sometimes it automatically stop with an error:
    "After Effects Error: Rendering error while writing to file. An output module failed. The file may be damaged or corrupted (-1610153464)"
    This error shows up if I manually stop the rendering process.
    If I disable "Render Multiple Frames Simultaneously" it render without any trouble, but that is not the point, I was able to render using that feature without any trouble before and I doubt I should have any trouble with my current specs.
    When I close AE, multiple "aeselflink" keep running about 15% each one.
    What I'm aware off:
    - I have the latest After Effects version from the Creative Cloud.
    - I have quicktime installed, since It comes in the core of OSX.
    - I have fixed my permissions.
    - I have deleted ALL the Adobe folders from "Preferences" Library folder.
    - I have reinstalled After Effects 2 times.
    - Adobe Media Encoder renders without any trouble
    - I have tried to render .mov, tiff sequences, mpeg, flv, all with the same results.
    Using OSX 10.8.3 with 32GB RAM and i7 processor (4 cores with 8 cores running with hyper threading).
    Thanks in adnvace.
    Here is a video:

    Stock answer no. 1: You have installed a CoDec (or Quicktime Component) that is not safe for MP rendering and messing up things. Could be an audio device driver, something liek a screen recording software or speech-to-text tool, could be Skype or similar even. check that and remove the relevant QT extensions/ diable them.
    Mylenium

  • Select multiple frames across multiple pages for photos frames

    Hi people!
    How can i select multiple frames across multiple pages? I want my images to fit the frames by one click. I do not want to go through each page one by one . There must be some way to solve this.. or? Cant find a options that can do that so far?
    Useing Adobe Indesin CS6.
    thanks!

    suppien_ wrote:
    How can i select multiple frames across multiple pages?
    You can't.
    You can do it in Find/Change box. Set desired Frame Fitting Options in Object section and run find/change.

  • Show multiple frames in a single SWFLoader

    Hello,
    I am loading a document contained in an .swf file, each page is in a single frame, to an SWFLoader. The SWFLoader shows a single frame at a time.
    I would like to show multiple frames at once and be able to manipulate them together (scaling, positioning).
    I know how to do it with a single frame easily, but is it possible with 2 or more frames?
    Thank you in advance,
    Mr Cartman.

    A SWF can only show one frame at a time.

  • Apply border to multiple frames

    I would like to know if I can apply the small border preset to all of the photos in a montage. It could save me a lot of time if I knew how to apply this to multiple frams.

    I have over 100 still photos in the timeline. I wanted each one to use the preset frame in the effects set.
    I thought I had seen that technique one time in a tutorial.
    made sense to me that you could select all stills in a timeline and drag the effect to all frames at once.
    but. . .that wasn't it.
    Original Message

  • Same JVM for multiple Frames in a web application

    Hi guys,
    I have a web application that loads an applet during login. Once the login is completed, the web application will display the available functions accessible with a menu on the left frame and the main display page on the right frame. Whenever any form action is perfomed on the right frame, the jvm with the login session seems to exit (java console closes) and the applet will be loaded to prompt the user to login again. The JRE installed on the Windows client is 1.6.0_14 from SUN.
    I'm guessing that the different frames are using different JVMs?
    Is there a way to use the same jvm for a web application with multiple frames? I want to prevent the case where the user will have to login again.
    Thanks for any advice!
    - Zen -

    I have sort of the same problem
    [Identical applets in the same JVM, next generation plugin issue|http://forums.sun.com/thread.jspa?threadID=5396118]
    I have submitted a Request for enhancement to SUN to allow forced grouping of applets in the same JVM.
    Sort of the opposite of the "separate_jvm" Applet tag parameter.
    It seems there is currently no way to do this.
    [New Plugin command line args|https://jdk6.dev.java.net/plugin2/jnlp/#COMMAND_LINE_ARGS]
    When per-applet JVM command-line arguments are specified, it is likely that the new Java Plug-In will need to launch another JVM instance in order to satisfy them. In other words, it is unlikely that a preexisting JVM instance will have been started with the correct set of command-line arguments to satisfy the current applet's request. The rules for exactly when a new JVM instance is launched to start a given applet are deliberately left unspecified, as this functionality is brand new in the 6u10 release and may need to change in subsequent releases. Here is a rough set of guidelines for the sharing and creation of new JVM instances:
    * If the command-line arguments used to start a preexisting JVM instance are a superset of the requested arguments, the preexisting JVM instance will be used.
    * If a JVM instance is launched for the "default" set of command-line arguments (i.e., those specified in the Java Control Panel, with no per-applet arguments specified), then this JVM instance will never be used to launch any applet that has even one per-applet command-line argument.
    * -Xmx is handled specially: if a preexisting JVM instance was started with for example -Xmx256m, and a new applet requests -Xmx128m, then new applet will very likely be run in the preexisting JVM instance. In other words, -Xmx specifications are matched with a greater-than-or-equal test.
    There is no way to "name" a JVM instance used to launch a particular applet and "force" subsequent applets into that JVM instance.
    See the section on the separate_jvm parameter to isolate a particular applet in its own JVM instance, separate from all other applets.

  • What does the edit multiple frames option in the Timeline do?

    What does the edit multiple frames option in the Timeline do?
    Thanks.

    dzedward wrote:
    > Edit Multiple Frames allows you to do just that, edit
    multiple frames. Click it, and select a range of frames, it makes
    changing colors/shape/etc of instances quick and painless.
    or imagine you import large images sequence (200 hundred) and
    need to reposition them all :)
    The edit multiple frames options comes handy in such case...
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Premiere Elements 8 shows MULTIPLE FRAMES ON SAME CLIP AFTER RENDERING

    I  manually rendered clips on PRE8 on the time line.  When it finished I found multiple frames from the same clip on the sceneline.  Does anyone knows whether this is normal?

    Unfortunately, video from still cameras almost never works in Premiere Elements.
    The FAQs to the right of this forum offer suggestions for converting it to a more standard DV-AVI.
    http://forums.adobe.com/thread/415317?tstart=0

  • Move multiple frames in the motion editor?

    Hi! Is there a way to move multiple frames in the motion editor (CS4)? Like now I have to move them one by one and it's hard to make them keep their values coz the shift+move doesn't seem to work. Or should it?
    Regards / Jimmy

    You can move multiple property keyframes for a single property in the Motion editor. Shift-click them and then drag. You cannot move keyframes across different properties, however.
    If you want to move *all* keyframes on mutliple frames, you want to do this on the main timeline. Ctrl/cmd+drag across the frames to select the multiple frames, and then drag them on the tween span.

  • Multiple frames in report - Need output on 1 page (not one frame per page)

    Hi
    I have a report with multiple frames and in the output they are printing one frame per page. How can i have one below the other and not have this page break?
    Thx.

    Check the following in frame properties:
    Maximum Records per Page: should be 0
    Page Break Before: should be No
    Page Break After: should be No

  • With PE10 export multiple frames

    Hi, is there a way in PE10 to export multiple frames to multiple jpg/bmp files, other than one freeze frame at a time.   Or is there a plug in that will do this?

    You need to use Export As Sequence in the Share> Computer> Image advanced settings.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

Maybe you are looking for

  • Macbook Pro built-in iSight in Adium and MSN Messenger?

    All of my contacts (about 100 or so) have MSN messenger accounts. Is there a way for me to use my built-in iSight as a webcam in Adium or MSN Messenger? It just seems pointless otherwise since I only know 2 or 3 other people with .mac or AIM accounts

  • New G560 crashes every few minutes windows 7 BSOD 0x00000124

    We just bought the new G560 using windows 7. The system crashed after the first 10 minutes with a BSOD; it crashes constantly/every few minutes. The code is 0x00000124 I see comments from others that this is a hardware conflict. This is a laptop star

  • Sound not working with Firefox

    I have firefox installed (Shiretoko) and installed the flash plugin and java plugin. Flash seems to work but without any sound. I am positive that it was working at first. I'm not sure exactly when it stopped working but I think it was when i install

  • Spaces and Missing Windows

    I've been using 10.5 since its release, and prefer to work with a number of Spaces open. Without fail, a number of times per day an application (seemingly random) will disappear from its Space, and (though still clearly running) be unable to be recov

  • Satellite L350D-216: Green lines, dots and shadows.

    Hello all. About three days ago, I purchased a laptop (Toshiba L350D, released about July '09 I believe) second hand on a good deal. I turn it on today, to discover a series of weird green lines, dots and shadows, most of which make areas of text har