JTabbed Pane and Opaqueness ??????????????????

Hi All,
I have developed an application in Swing that uses JTabbedPane.The tabbed pane(say tabbedpane X),has a panel which is in turn made from 2 panels,say panel A and panel B.
I want to display the space beween the 2 panels,A and B by using the SetOpaque method.But this is not working.!!!!!!!!!!!!!!!!
Could any one explain or send me a sample code of "how to introduce opaqueness between 2 Panels originating from JTabbedPane "
Many Thanks,
Sabriz

You want to display the space between the two panels like showing the cellspaceing in HTML? Is that correkt?
Opaque isn't the right way to show this.. Opaque just turns on/off drawing the background of Components
Try this ...
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JPanel p = new JPanel(new GridLayout(2,2,10,10));
          p.setBackground(Color.BLACK);
          for(int i=0; i<4; i++) {
               JPanel tmp = new JPanel();
               tmp.setBorder(new LineBorder(Color.RED));
               tmp.setBackground(Color.GRAY);
               p.add(tmp);
          frame.setContentPane(p);
          frame.setSize(200, 200);
          frame.setVisible(true);Martin

Similar Messages

  • JCombobox on a jtabbed pane, AND Choice on jtabbed pane problems

    I have a Choice on a jtabbed pane, on a panel that isn't showing when the jtabbed pane is made visible. The Choice on the hidden pane is "bleeding" through to the first tabbed panel. help!
    If I click on the second tabbed panel (where the Choice is), and then click on the first tabbed panel, the Choice becomes hidden like it is supposed to.
    AND, I have a JComboBox on a JTabbedPane, it works for the most part, but when you click on it, the scrollbox underneath it doesn't appear! Instead, a grey box appears below it. Help!

    I was having similar problems when I was working with JFrames, Anything not covered by a piece of GUI would show other parts of my program (like the progress bar or buttons and stuff).
    Anyway, it went away when I used the setBackground() method. My guess is that using this forces the container to be opaque or something. Anyway, it worked for me, maybe it will work for you also.
    Steve

  • X JPanels in a JTabbed pane.

    I'm wondering if anyone can help.
    I have an application consisting of a JTabbed pane, within this there should be 'x' JPanels. Each JPanel has 3 RadioButtons and 5 Text fields. I need to be able to refer to each radio button and text field as RB0 - RBx and TF0 - TFx.
    It is obviously easy enough to do this for just 3 or even 20 (despite a lot of coding), however, my problem is getting a variable number (x) of Panels with respective variable numbers of TF and radio buttons.
    Simply I need to produce an array of panels, radiobuttons and textfields....
    anyone anyideas?

    another way of looking at it is to think how can I make 5 of exactly the same panel (just with different names) in the same tabbed frame in just one bit of code that is called 5 times - or x in this case.

  • 2nd time posting: Flashing JTabbed Pane?

    I'm trying to use a JTabbed Pane wherein tabs are created dynamically from the server. In order to alert the the user of the client software that a new tab has been created, I would like the top of the tab to flash or blink with a different color. any ideas how to do this? I really do want to avoid doing stuff like writing my own component etc.
    Tia,
    carlos

    You can use:
    tabPane.setBackgroundAt(i, Color.red);to set the background of tab number "i" to red, and
    you can use:tabPane.setBackgroundAt(i, tabPane.getComponentAt(i).getBackground());to set the background of tab number "i" back to its original color. If you do these in a loop with a delay, then you have a flashing tab.
    You can also change the font color if you want by using tabPane.setForeground(...) instead of setBackground(...)

  • Focus event with JTabbed pane

    How do I set FocusListener to fire with I select a specific tab in a JTabbed pane? If I put the FocusListener on the Tabben pane it fires rquardless of which tab I select and if I try to use an if statement to single out a specific tab nothing happens.

    If you are interested in listening to when a tab is selected you can use a ChangeListener:
    JTabbedPane tab = ...
    tab.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            // get the selected tab-index:
            int index = ((JTabbedPane)e.getSource()).getSelectedIndex();
    });Btw, Swing related posts should be posted in the Swing forum.

  • Jtabbed pane is listening to the keyboard, how do i stop?

    hello
    this is probobly a simple Swing problem. i have a j3d canvas inside a tabbed pane with other info on other panes. i need the keyboard to listen on the canvas so i can move around the j3d world, but the left and right are being detected by the jtabbed pane, but i didnt add any listen to those. how can i stop this behavior from occuring? its very annoying.
    i appreciate any help you can lend..

    The reason it is responding to keyboard events is becuase it has the focus. Request focus on the component in the tab, and the tabbed pane should stop responding. If that doesn't work, try this:
    JTabbedPane tabbed = new JTabbedPane();
    KeyStroke[] keys = tabbed.getRegisteredKeyStrokes();
    for (int i=0; i<keys.length; i++) {
    int code = keys.getKeyCode();
    if (code == KeyEvent.VK_LEFT || code == KeyEvent.VK_RIGHT) {
    tabbed.unregisterKeyboardAction(keys[i]);

  • Jtabbed pane problem + flags printout

    Hi,
    I am having difficulty displaying a JTabbedPane which is contained by a dialog. When I display the Dialog for the first time the Tabbed displays perfectly - anytime after that it disappears.
    I found this really strange so I put in some printout statements for the JTabbed pane here's what I got
    When it displays the prinout for the JTabbed pane is ............................
    extCellTabbedPane
    rnh.adj.cellhandovermgt.gui.refactor.ExtCellTabbedPane[,0,0,0x0,invalid,layout=javax.swi
    ng.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout,alignmentX=null,alignmentY=null
    ,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,t
    abPlacement=TOP]
    When it does n't display the prinout for the JTabbedPane is
    rnh.adjcellhandovermgt.gui.refactor.ExtCellTabbedPane[,0,67,193x45,inv
    alid,layout=javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout,alignmentX
    =null,alignmentY=null,border=,flags=16,maximumSize=,minimumSize=,preferredSize=,
    haveRegistered=false,tabPlacement=TOP]
    What I am interested in is the meaning of the parameter flags. In one case it is 0 and in one case it is 16? What does this parameter mean? Where I can get some information on this as I think this will tell me what is happening to the JTabbedPane.
    Thank you in Advance
    Alex

    The flags item reflect the flags value in JComponent
    class. It represents several status
    of the component:
    REQUEST_FOCUS_DISABLE
    IS_DOUBLE_BUFFERED
    ANCESTOR_USING_BUFFER
    IS_PAINTING_TITLE
    HAS_FOCUS
    IS_OPAQUE
    As my understand about your problem, this may be no
    help for you to locate the error
    As the message you post, you might use a third
    implementation of JTabbedPane, so the
    problem might be in the implementation. I
    have used JTabbedPane often with no error
    like you say :)
    Hope this Helps!Thanks for your help here - I would like more information if possible i.e. a numerical mapping for each property - do you know where I could get this. I don't really understand what you mean about the Third implementation. Do you mean simply extend the JTabbedPane? Thisis what I do but I don't really know what part to change to stop it disappearing. Thanks once again. Anymore help would be greatly appreciated.

  • JTabbed pane customize title on selection

    Hi all
    i want to change the title font when a tab is selected.I add a ChangeListener to my JTabbed pane to intercept tab selection and to change font via html.
    I have some proble ex:
    if i click on tab4, it correctly change font but the tab2 take the title of the tab1 and so on.
    This is the code
              ChangeListener changeListener = new ChangeListener()
                   public void stateChanged(ChangeEvent changeEvent)
                        JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.
                             getSource();
                        int index = sourceTabbedPane.getSelectedIndex();
                        for (int i = 0; i < sourceTabbedPane.getTabCount(); i++)
                             if (i == index)
                                  sourceTabbedPane.setTitleAt(i,
                                       "<html><b>" + sourceTabbedPane.getTitleAt(i) + "</html>");
                             else
                                  String desc  = sourceTabbedPane.
                                       getTitleAt(i).replaceAll("<html>", "").
                                       replaceAll("<b>", "").replaceAll("</html>", "");
                                  sourceTabbedPane.setTitleAt(i, desc);
                        System.out.println("***********************");
                        for (int i = 0; i < sourceTabbedPane.getTabCount(); i++)
                             System.out.println(sourceTabbedPane.getTitleAt(i));
              };The last system.out show me the correct tirtle, only the selected with html but on screen i see some mixed title.Where i'm wrong?

    I hope can you help me:
    public static void main(String[] arg)
            JTabbedPane jTabbedPane = new JTabbedPane();
         jTabbedPane.addTab("Tab1", new JPanel());
         jTabbedPane.addTab("Tab2", new JPanel());
         jTabbedPane.addTab("Tab3", new JPanel());
         jTabbedPane.addTab("Tab4", new JPanel());
         jTabbedPane.addTab("Tab5", new JPanel());
         jTabbedPane.addTab("Tab6", new JPanel());
         jTabbedPane.addTab("Tab7", new JPanel());
         jTabbedPane.addTab("Tab8", new JPanel());
         ChangeListener changeListener = new ChangeListener()
            public void stateChanged(ChangeEvent changeEvent)
              JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.
              getSource();
              int index = sourceTabbedPane.getSelectedIndex();
              for (int i = 0; i < sourceTabbedPane.getTabCount(); i++)
                      if (i == index)
                           sourceTabbedPane.setTitleAt(i,
                        "<html><b>" + sourceTabbedPane.getTitleAt(i) + "</html>");
                   else
                        String desc = sourceTabbedPane.getTitleAt(i).replaceAll(
                        "<html>", "").
                        replaceAll("<b>", "").replaceAll("</html>", "");
                   sourceTabbedPane.setTitleAt(i, desc);
              System.out.println("***********************");
              for (int i = 0; i < sourceTabbedPane.getTabCount(); i++)
                   System.out.println(sourceTabbedPane.getTitleAt(i));
         jTabbedPane.addChangeListener(changeListener);
         JDialog dialog = new JDialog(new JFrame(),true);
         dialog.getContentPane().add(jTabbedPane);
         dialog.setPreferredSize(new Dimension(300,300));
         dialog.setSize(new Dimension(300,300));
         dialog.setVisible(true);
    }

  • Is there a way to create a pan and zoom effect in a lightroom slideshow?

    Is there a way to create a pan and zoom effect in a lightroom slideshow?

    Nope. Be a great feature. For that I use FotoMagico after exporting JPEG's from LR.

  • After aborted rebuild in Mail: I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up

    I have searched quite a bit to find a resolution to this problem, with no success. Any help would be appreciated.
    I decided to rebuild my inboxes by following this advice: http://support.apple.com/kb/PH11704. The rebuild took several hours and at 96% (4 minutes remaining apparently), the indexing froze (that is, after 8 hours, the message was still telling me "4 minutes left"). I forced quit mail, restored the previous Envelope files from the trash, and everything seemed fine.
    However, since this failed attempt, I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up. All messages in my various inboxes have the reloading problem, EXCEPT messages that I downloaded since the aborted rebuild (in other words, there are about 40 messages that I downloaded since I tried the rebuild and I have no problem with these). The other 70,000 messages however wont load, even though I can see them in the centre pane and spotlight has no problem finding them and showing me their contents (when I hover the mouse over the message). When I click on the message in spotlight, mail opens and the loading problem re-occurs.
    Since then, based on various suggestions I found for similar issues, I have used Disk Utility to verify and repair permissions and the drive. I used Onix to rebuild the Mail index (that only took about a minute - I am not sure how to interpret this when compared to the hours the rebuild took with Mail). No joy, I still have the same problem. I even restored one of my inboxes via Time Machine and the same issue with loading continues.
    I am using ML 10.8.2. I have a combination of IMAP accounts (work) and POP accounts (personal). The issue of loading occurs irrespective of the account.
    I am baffled and am now considering migrating to either Thunderbird or Postbox 3 to try and solve my problem. I prefer to stay with Mail. I should note also that I am using MailTags with Mail (http://www.indev.ca/MailTags.html), although I have not used any of the features. I upgraded to ML from SL about 2 weeks ago. It was very smooth and there appear to be no issues (not sure how helpful this is and probably not at all related to this issue).
    Any suggestions much appreciated!

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • Force subvi to open in one of main vi's pane and stick to top left corner

    I have a subvi that opens in a event case, and in the main VI i have several panes, how to force a subvi's run-time position so that it opens in a specified pane and sticks in the left top corner of that pane. i might need to make the subvi size same as that pane if it resizes.
    any help is appreciated
    Thanks

    It does sound like you are looking for subpanels. A sunpanel is a special kind of indicator into which you can insert the front panel of another VI.
    You can programatically resize the front panel of a VI, but the problem you are going to run into is that a VI that is running inside a subpanel doesn't know that it is in a subpanel and so can't automatically track changes in the subpanel size. You will need to define some sort of mechanism for communicating the size of the subpanel.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do I use pan and zoom on vertical photographs without editing out most of the photo?

    I am trying to make a slide show.  When I have a vertically oriented (portrait) photograph and try to use pan and zoom, the feature eliminates much of the photograph.  It seems the pan and zoom feature only works for horizontally oriented (or landscape) photographs.  Is there a way to use pan and zoom on vertically oriented photographs to capture all or most of the photograph and zoom in from there?

    gtavetian
    I decided to use a different strategy to convey the principle. It is most likely that your photos will be 4:3 and you may or may not be taking them into a SD widescreen or HD widescreen project. With all those variables, to get the basic ideas across, I am going to use two models with a generalized scheme.
    For this post....
    NTSC DV Standard Project - Portrait Oriented JPG, in this case 2448 x 3264 3:4. Could be any Portrait Oriented JPEG any pixel dimensions. But best plan ahead for what you have and what you would like.
    Manually set the project preset to NTSC DV Standard.
    File Menu/New/Project and, in the new project dialog, set for NTSC DV Standard.
    Before exiting the final dialog in that area, put a check mark next to "Force Selected Project Setting on This Project". Close out of there.
    Next go to the Edit Menu/Preferences/General and remove the check mark next to "Default Scale to Frame Size". Close out of the preferences.
    In the opened Premiere Elements Expert workspace, use Add Media/Files and Folders/Project Assets to get your portrait oriented JPG to the beginning of the Timeline.The 2448 x 3264 3:4 will overwhelm the space in the Edit Mode monitor. That is to be expected. The Timeline Indicator is at the beginning of the Timeline @ 00;00;00;00.
    a. Click on the Timeline jpg to select it. With Motion Panel/Scale property (with Constrain Proportions with check mark), you want to scale the image so that the whole is shown within the mode space. You want to see the image's bounding box. See the next screenshot. The bounding box is the white outline around the image. It has handles.
    After the scaling to get that look, the important information that you want is on the right in the Motion Panel
    Position values 360.0 and 240.0
    Scale value 14.6%.
    The next phase is as before (See post 21 of this thread...but much of that is repeated below and modified for what is being described at this moment)
    With Timeline Indicator at the beginning of Video Track 1 (00;00;00;00), go to Tools Menu/Pan and Zoom and click on it to open  the Pan and Zoom workspace.
    In the Pan and Zoom workspace, you will see that the feature has created the initial two Focus Frames for you. 
    Do not do anything to Focus Frame 1 in the bin below the image window.
    Click on Focus Frame 2 in the bin below the image window and set the Focus Frame as wanted.
    Click on New Frame in the panel to the left of the image window  to create a third Focus Frame which will appear in the bin. Set Focus Frame as wanted.
    Click on New Frame in the panel  to the left of the image window to create a fourth Focus Frame which will appear in the bin. Set the Focus Frame as wanted.
    Click Done to the Pan and Zoom workspace so that you are back in the Premiere Elements Expert workspace with its Timeline.
    In the Expert workspace,
    Move the Timeline Indicator to the last frame of the selected pan and zoom clip 1. In Applied Effects Tab/Applied Effects Palette/Motion Panel expanded, (Toggle Animation should be active at this point), make sure Position settings are 360.0 and 240.0 and Scale = 14.6% (with Constrain Proportions used).Then go to Tools Menu/Freeze Frame and set the freeze frame for 3 seconds and hit Insert in Movie.
    Then move the Timeline Indicator to the first frame of the selected pan and zoom clip 1. In Applied Effects Tab/Applied Effects Palette/Motion Panel expanded (Toggle Animation should be active at this point), make sure Position settings are 360.0 and 240.0 and Scale = 14.6% (with Constrain Proportions used). Then go to Tools Menu/Freeze Frame and set the freeze frame for 3 seconds and hit Insert in Movie.
    Render.
    The Timeline content sequence from start to finish should be:
    Freeze Frame 3 seconds First Frame of pan and zoom clip 1
    Pan and zoom clip 1
    Freeze Frame 3 seconds Last Frame of pan and zoom clip 1
    Freeze Frame 3 seconds First Frame of pan and zoom clip 2
    Pan and zoom clip 2
    Freeze Frame 3 seconds Last Frame of pan and zoom clip 2
    A Dissolve/Cross Dissolve Video Transition (1.00 seconds) is placed between end of Freeze Frame  Last Frame of pan and zoom clip 1 and beginning of Freeze Frame 3 First Frame of pan and zoom clip 2.
    Additional pan and zoom portrait oriented jpgs to the Timeline would be treated as above.
    What was done above can be applied to any photo with any project preset. The basic idea is to
    a. Start with determing the whole picture Position and Scale values as described with the Default Scale to Frame Size option disabled.
    b. Do pan and zoom with Pan and Zoom Tool in its workspace
    c. Return to Premiere Elements workspace to apply your Position and Scale values to the last frame of pan and zoom clip so that the last frame presents in full clip view. Then go to the first frame of the pan and zoom clip, and apply the Position and Scale values to it so that the first frame presents in full clip view.
    d. If you want the whole view to present for more than that one frame, do the freeze frame at each end, with the wanted duration.
    e. Apply emblessments as wanted, such as video transitions, an animated graphic flying through the last scene, etc.
    We could take this same clip into a NTSC AVCHD Full HD 1080p30 project and do the same, except the Position and Scale values and the Scale % determined at the beginning and used subsequently will be different than in the NTSC DV Standard project.
    Please check out the above and see how you do with it. If problems, please indicate where and we will work through them.
    Thanks.
    ATR

  • How to set the duration of each pic in a slideshow (and also how to pan and zoom)

    I have about 30 pictures I would like to add to a slide show.
    When I add them the duration for each picture is set to 6 seconds.
    I would like this changed to 4 seconds.
    But manually changing the duration of each individual picture, one by one, is a slow and tedious task.
    Is there a way of changing the duration of all my pictures at the same time, from 6 seconds to 4 seconds ?
    Or can I change a setting so that when I insert my pictures the duration is set to 4 seconds instead of 6 seconds ?
    As for the pan and zoom, I have seen the pan and zoom effect but this has a black border around the pictures as they zoom in and out.
    For example, when zooming in the picture starts small with a black border all round the edge.
    When zooming out the picture ends small with a black border all round the edge.
    Is there a way to pan and zoom starting with a full screen when zooming in, and ending with a full screen when zooming out ?
    Thereby not showing any ugly black borders.
    My Nokia N73 phone can do it !
    You can view the pictures as a slide show and when it pans and zooms it looks so much better because it does not show any black borders.
    The picture ALWAYS fills the screen even though it is panning and zooming.

    If you go to Edit/Preferences, you can set the default duration for each slide. This will affect only those photos you've imported into your project AFTER changing this preference.
    You should also turn off the preference for Scale to Frame Size, so your photos do not fill the screen. (And, for efficiency's sake, make sure your source photos are no larger than 1000x750 pixels, per the FAQs at the top of this forum.)
    You can also set the duration of each slide by selecting all of the stills you want to include on in your slideshow, right-clicking and selecting the Create Slideshow option.

  • Possible to pan and scan HD video with your home editing software?? (HD - SD size)

    Hi, using Premiere Elements 7 on WinXp and also on Win 7.
    I wonder if it's possible for us to do a pan and scan type process with our HD video? I ask because someone gave me some footage from the weekend where the composition was way too wide and large and I'd like to save the video, composed better, an SD quality.
    Given the pixel resolution it should be possible. I know that's how they convert 35mm film to fit TV, but when it comes to video, can Premiere do it?
    I can crop video in premiere but it will save the video at the same resolution, but all pixelized and looking wonky. How would I save 1080i video pan and scanned to 720 (p) or regular SD (640) which will still look decent on Youtube.
    Here is an example (note, I also squeezed the footage to 97% horizontally first)
    Can anyone give a tutorial?
    Thanks

    If it's hi-def video, you can import the video into a project set up for standard DV.
    Before you use Get Media to get the video, go to Edit/Preferences and uncheck Scale to Frame Size.
    When you place your video on the timeline, it will be much larger than the Monitor, and you will only see a portion of it. You should be able to use Crop and Scale to get just what you need and still have many pixels to spare. (And don't forget to press Enter to render the video before you judge its quality.)
    Note that, depending on what format of video your original footage is in, you may need to work with the interlacing maybe reverse the field dominance. So I'd do a short test run and output to see how it looks before I committed to a full-length project.

  • I imported a video I make in another program and I played it back in the video editor and I like the pan and zoom that was added by the program how do I save a copy with the effect of Premiere elements 12

    I imported a video I make in movie maker program and I played it back in the premiere video editor and I like the pan and zoom that was added by the program how do I save a copy with the effect of Premiere elements 12
    all I did was played it back how do I save that and make a new version of the video beacause when I save a copy the effect look I was trying to save was not there.
    Rodney
    [personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
    [This is an open forum, not Adobe support, please do not post personal information]
    [If you are posting using email, please turn your 'sig file' function OFF for posting]

    silkman1
    I would be glad for the opportunity to customize a Premiere Elements 12 answer to your Premiere Elements 12 issue.
    But, I want to make sure that we are together on the details. This is my understanding of what you have written. Please review and let me
    know if I am misinterpreting anything that you have written.
    You have a video created in Windows Movie Maker.
    How did you output the video from Windows Movie Maker...wmv or mp4, what was the frame size and frame rate of that export?
    Next you import that video into Premiere Elements 12 (can we assume that this is on Windows 7, 8, or 8.1 64 bit?)
    From what you wrote, you have applied a pan and zoom effect to your video in Premiere Elements.
    Now you go to export the Premiere Elements 12 Timeline content with your video with the pan and zoom applied.
    But, the pan and zoom effect is not seen in playback of the export.
    Is all of the above correct so far?
    If so....we are going to need some more details from you...
    a. What is the project preset that you or the project are setting to match the properties of the video coming from Movie maker? See Edit Menu/Project Settings/General and the readings for Editing Mode, Timebase, Frame Rate, and Pixel Aspect Ratio even if the fields look grayed out.
    b. Are you applying the pan and zoom effect with the Pan and Zoom Tool, fx Effects Presets, or keyframing the Scale (for Zoom) and
    Position (for Pan) in the Motion Panel expanded?
    c. What are you selecting as your export in Publish+Share/. Please give details...are you using default settings or customizing the export
    setting under the Advanced Button/Video Tab and Audio Tab of the preset selected?
    I am suspecting some sort of mismatch of your project settings or some problems with working with the Pan and Zoom tool. I need
    your answers to help me help you. If I have written anything that you do not understand, please let me know. I will re-write if necessary
    so that we are in sync to resolve the issue.
    Thanks.
    ATR

Maybe you are looking for