Problem in scroll tab layout policy

Hi everyone!!
I made a application using tabbedpanes. My problem is when i put
an "x" button for close in the tab title area the scroll tab layout policy
are not working, but if no button it's working.
I need a closable Jtabbedpane with scroll tab policy.
Pls anyone help me.
It's my big appreciation

no i dont have the code,
i am just telling the idea....
create a image labels inspite of tabs create panels corresponding to it
add ur needs inside the panel and make it visible according to the tab clicked

Similar Messages

  • Problem with scroll tab layout in JtabbedPane

    Pls. if anyone know this, help me
    I have a problem, my scroll tab layout policy does not working when I set it to UI.
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.plaf.*;
    public class Components_Area extends JFrame{
         JTabbedPane tab = new JTabbedPane(JTabbedPane.TOP,JTabbedPane.SCROLL_TAB_LAYOUT);
         JLabel l[] = new JLabel[5];
        public Components_Area() {
              tab.setUI(new TestPlaf());
              tab.addTab("Untitled",l[0]);
              tab.addTab("Untitled",l[1]);
              tab.addTab("Untitled",l[2]);
              tab.addTab("Untitled",l[3]);
              tab.addTab("Untitled",l[4]);
              getContentPane().add(tab);
        public static void main(String args []) {
             Components_Area frame = new Components_Area();
             frame.setSize(200,200);
             frame.show();
         static class TestPlaf extends BasicTabbedPaneUI {
              protected LayoutManager createLayoutManager() {
                   return new TestPlafLayout();
              protected Insets getTabInsets(int tabPlacement,int tabIndex) {               
                   Insets defaultInsets = (Insets)super.getTabInsets(tabPlacement,tabIndex).clone();
                   defaultInsets.right += 50;
                   defaultInsets.top += 2;                
                   return defaultInsets;
              class TestPlafLayout extends TabbedPaneLayout {
                   //a list of our close buttons
                   java.util.ArrayList closeButtons = new java.util.ArrayList();
                   public void layoutContainer(Container parent) {
                        super.layoutContainer(parent);
                        //ensure that there are at least as many close buttons as tabs
                        while(tabPane.getTabCount() > closeButtons.size()) {
                             closeButtons.add(new CloseButton(closeButtons.size()));
                        tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
                        Rectangle rect = new Rectangle();
                        int i;
                        for(i = 0; i < tabPane.getTabCount();i++) {
                             rect = getTabBounds(i,rect);
                             JButton closeButton = (JButton)closeButtons.get(i);
                             //shift the close button 3 down from the top of the pane and 20 to the left
                             closeButton.setLocation(rect.x+rect.width-20,rect.y+4);
                             closeButton.setSize(15,15);
                             tabPane.add(closeButton);
                        for(;i < closeButtons.size();i++) {
                             //remove any extra close buttons
                             tabPane.remove((JButton)closeButtons.get(i));
                   // implement UIResource so that when we add this button to the 
                   // tabbedpane, it doesn't try to make a tab for it!
                   class CloseButton extends JButton implements javax.swing.plaf.UIResource {
                        public CloseButton(int index) {
                             super(new CloseButtonAction(index));
                             setBorder( BorderFactory.createEmptyBorder() );
                        setToolTipText("Close this tab");
                             //remove the typical padding for the button
                             setMargin(new Insets(0,0,0,0));
                        addMouseListener(new MouseAdapter() {
                                  public void mouseEntered(MouseEvent e) {                           
                                   setBorder( BorderFactory.createLineBorder(Color.black, 1 ));
                                 public void mouseExited(MouseEvent e) {                                
                                      setBorder( BorderFactory.createEmptyBorder() );
                   class CloseButtonAction extends AbstractAction {
                        int index;
                        public CloseButtonAction(int index)     {
                             super("x");
                             this.index = index;
                        public void actionPerformed(ActionEvent e) {
                             tabPane.remove(index);
    }     Message was edited by:
    henyo

    If someone knows this, help me!

  • Siebel Sales Enterprise 8.0.0.8 - problem with Screen Tab Layout

    Hello all !
    I create [Manager] Resonsibility and check hide [Opportynities screen] in Screen Tab Layout for [Manager] Resonsibility for Siebel Sales Enterprise.
    I added user Bob with [Manager] resonsibility.
    But user Bob stiil see Opportunities Screen when log on.
    User Bob has no other resonsibilities.
    I cannot inactivate Opportynities screen because this screen used by other resonsibilities.
    What is cause of with issue?
    Best Regards
    Lev

    Hello,
    Did you delete the user preferences of this user prior to your test ?
    I also assumed that the default view is not part of Opportunity screen when you log in.
    Best Regards
    EvtLogLvl

  • Struts-Layout layout:tabs Problem; dynamically render tabs

    hi,
    i have been trying to combine the <layout:collection> and <layout:tabs> tags to dynamically render tabs. (if the collection contains 5 objects, i wanna have 5 tabs, and if the collection contains 2 objects, i wanna have 2 tabs...)
    like this:
    <layout:form action="/someAction.do" styleClass="FORM">
    <layout:tabs styleClass="FORM" width="400">
    <layout:collection property="aProperty" indexId="index" >
    <layout:tab key='${index}' width="50">
    <layout:collectionItem title="rooms.token">
    <layout:text property="aProperty[${index}].BID" layout="false" size="5"/>
    </layout:collectionItem>
    </layout:tab>
    </layout:collection>
    </layout:tabs>
    </layout:form>
    It renders, but it is not displayed correctly. for example, if there are 2 objects in the collection, i get 3 tabs. and the rendered html-table contains mistakes and destroys my page.
    has anyone an idea what i could do?
    I appreciate any help, thank you, martin

    Do anyone kno more about Struts-Layout-tabs...........In a Struts forum? Probably.

  • Problems with scrolling and Mission Control

    I have this problem:
    When scrolling down any page, the letters will blur at the top of the screen and not the bottom.
    When swiping acrross pages in the launchpad, it occasionaly freezes half way between the two.
    When I swipe up with four fingers to access mission control, the screen becomes very sluggish. Swiping back down (or clicking a tab) is even worse, causing slow "laggy" animations.
    And this the report from EtreCheck:
    Hardware Information:
              MacBook Pro (13-inch, Mid 2012)
              MacBook Pro - model: MacBookPro9,2
              1 2.5 GHz Intel Core i5 CPU: 2 cores
              4 GB RAM
    Video Information:
              Intel HD Graphics 4000 - VRAM: 1024 MB
    System Software:
              OS X 10.9.2 (13C1021) - Uptime: 0 days 0:3:16
    Disk Information:
              APPLE HDD HTS545050A7E362 disk0 : (500.11 GB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        Macintosh HD (disk0s2) / [Startup]: 499.25 GB (309.44 GB free)
              HL-DT-ST DVDRW  GS41N 
    USB Information:
              Apple Inc. Apple Internal Keyboard / Trackpad
              Apple Computer, Inc. IR Receiver
              Apple Inc. BRCM20702 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Inc. FaceTime HD Camera (Built-in)
    FireWire Information:
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Configuration files:
              /etc/hosts - Count: 1
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist Support
              [loaded] com.microsoft.office.licensing.helper.plist Support
    Launch Agents:
              [not loaded] com.bose.soundtouch.plist Support
    User Launch Agents:
              [loaded] com.adobe.ARM.[...].plist Support
              [loaded] com.google.keystone.agent.plist Support
              [running] com.spotify.webhelper.plist Support
    User Login Items:
              iTunesHelper
              Spotify
              BitTorrent
              Autodesk 360
    Internet Plug-ins:
              SharePointBrowserPlugin: Version: 14.0.0 Support
              FlashPlayer-10.6: Version: 13.0.0.201 - SDK 10.6 Support
              AdobePDFViewer: Version: 10.0.0 Support
              Flash Player: Version: 13.0.0.201 - SDK 10.6 Support
              QuickTime Plugin: Version: 7.7.3
              Default Browser: Version: 537 - SDK 10.9
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
              AirPlay: Version: 2.0 - SDK 10.9
              AppleAVBAudio: Version: 203.2 - SDK 10.9
              iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
              Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    3rd Party Preference Panes:
              Flash Player  Support
    Time Machine:
              Time Machine not configured!
    Top Processes by CPU:
                   2%          WindowServer
                   2%          SoundTouch music server
                   0%          fontd
                   0%          BitTorrent
                   0%          mds
    Top Processes by Memory:
              90 MB          mds_stores
              86 MB          Safari
              78 MB          Spotify
              57 MB          Spotify Helper
              49 MB          ocspd
    Virtual Memory Information:
              1.83 GB          Free RAM
              1.44 GB          Active RAM
              190 MB          Inactive RAM
              558 MB          Wired RAM
              303 MB          Page-ins
              0 B          Page-outs

    I have this problem:
    When scrolling down any page, the letters will blur at the top of the screen and not the bottom.
    When swiping acrross pages in the launchpad, it occasionaly freezes half way between the two.
    When I swipe up with four fingers to access mission control, the screen becomes very sluggish. Swiping back down (or clicking a tab) is even worse, causing slow "laggy" animations.
    And this the report from EtreCheck:
    Hardware Information:
              MacBook Pro (13-inch, Mid 2012)
              MacBook Pro - model: MacBookPro9,2
              1 2.5 GHz Intel Core i5 CPU: 2 cores
              4 GB RAM
    Video Information:
              Intel HD Graphics 4000 - VRAM: 1024 MB
    System Software:
              OS X 10.9.2 (13C1021) - Uptime: 0 days 0:3:16
    Disk Information:
              APPLE HDD HTS545050A7E362 disk0 : (500.11 GB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        Macintosh HD (disk0s2) / [Startup]: 499.25 GB (309.44 GB free)
              HL-DT-ST DVDRW  GS41N 
    USB Information:
              Apple Inc. Apple Internal Keyboard / Trackpad
              Apple Computer, Inc. IR Receiver
              Apple Inc. BRCM20702 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Inc. FaceTime HD Camera (Built-in)
    FireWire Information:
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Configuration files:
              /etc/hosts - Count: 1
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist Support
              [loaded] com.microsoft.office.licensing.helper.plist Support
    Launch Agents:
              [not loaded] com.bose.soundtouch.plist Support
    User Launch Agents:
              [loaded] com.adobe.ARM.[...].plist Support
              [loaded] com.google.keystone.agent.plist Support
              [running] com.spotify.webhelper.plist Support
    User Login Items:
              iTunesHelper
              Spotify
              BitTorrent
              Autodesk 360
    Internet Plug-ins:
              SharePointBrowserPlugin: Version: 14.0.0 Support
              FlashPlayer-10.6: Version: 13.0.0.201 - SDK 10.6 Support
              AdobePDFViewer: Version: 10.0.0 Support
              Flash Player: Version: 13.0.0.201 - SDK 10.6 Support
              QuickTime Plugin: Version: 7.7.3
              Default Browser: Version: 537 - SDK 10.9
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
              AirPlay: Version: 2.0 - SDK 10.9
              AppleAVBAudio: Version: 203.2 - SDK 10.9
              iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
              Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    3rd Party Preference Panes:
              Flash Player  Support
    Time Machine:
              Time Machine not configured!
    Top Processes by CPU:
                   2%          WindowServer
                   2%          SoundTouch music server
                   0%          fontd
                   0%          BitTorrent
                   0%          mds
    Top Processes by Memory:
              90 MB          mds_stores
              86 MB          Safari
              78 MB          Spotify
              57 MB          Spotify Helper
              49 MB          ocspd
    Virtual Memory Information:
              1.83 GB          Free RAM
              1.44 GB          Active RAM
              190 MB          Inactive RAM
              558 MB          Wired RAM
              303 MB          Page-ins
              0 B          Page-outs

  • "Finder" is annoying me with its size (scroll "tabs")

    The scroll-bar is annoying me.
    Whenever I open Finder, or actually insert a disk, that happens (the side view scroll "bar, tab"). And I think I've fixed the icons (too big space between them).
    But how do I fix the sidebar scroll "tab"? It's really annoying seeing that tab comes up, I have some obession fixing it by changing the size of the whole window. But that is quite annoying in the long-run. Lol.

    Umm,
    This Original seems to have excessive tags.
    I found it searching for ichat_macosx_v10.6
    Admittedly I tend to restrict myself to Posting about iChat and that is my problem.
    However it makes it difficult or others to search effectively if it is labled with too many irrelevant tags.
    9:08 PM      Friday; May 6, 2011
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
    , Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How do I prevent tab focus from changing when I scroll tabs with the mouse wheel? [SOLVED]

    Whenever I scroll my tabs with the mouse scroll wheel the tab focus changes from the page I'm currently on to the tab being scrolled to. I usually have a large list of tabs open and I depend on being able to scroll tabs without changing page focus to keep myself organized.
    Also, I'd like to disable tab scroll wrapping; Once I've scrolled my tabs to the end I'd like it to stop scrolling, not wrap around to the start of my tabs.
    Is there a way to disable these features and revert to the tab scrolling behaviour of a previous version of Firefox?

    This is not a standard feature and can be caused by an extension.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • Problem with scrolling a panel containing an image

    I am having a problem adding scrolling capabilities to a tabbed panel containing pages containing an image. In my program, I have a class called ImagePanel that extends JPanel and contains an image read from a file. In another class, I create a tabbed panel and add to it ImagePanels.
    The problem I'm facing is that the pages added to my tabbed panel contain scroll bars, but these scroll bars are not scrollable (i.e. I cannot use the bars the scroll and see the missing parts of the image).
    Any help on this manner is highly appreciated.
    The code is shown below:
    JTabbedPane m_pathwayTabbedPane = new JTabbedPane();
    ImageIcon overviewImageIcon = IconLoader.readImageIcon(pathway.gif);
    ImagePanel overviewPanel = new ImagePanel(overviewImageIcon.getImage());
    JScrollPane graphcrollPane = new JScrollPane(overviewPanel,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    m_pathwayTabbedPane.addTab(StringManager.OVERVIEW, graphcrollPane);

    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class ScrollingImages
        public static void main(String[] args)
            String[] fileNames = {
                "images/bclynx.jpg", "images/mtngoat.jpg", "images/redfox.jpg"
            JPanel panel = new JPanel(new GridBagLayout());
            panel.setBackground(Color.black);
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(5,5,5,5);
            gbc.gridwidth = gbc.REMAINDER;
            for(int j = 0; j < fileNames.length; j++)
                panel.add(new ImageComponent(fileNames[j]), gbc);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(panel));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ImageComponent extends JPanel
        Image image;
        public ImageComponent(String fileName)
            loadImage(fileName);
            setBackground(Color.black);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            int imageWidth = image.getWidth(this);
            int imageHeight = image.getHeight(this);
            int x = (w - imageWidth)/2;
            int y = (h - imageHeight)/2;
            g.drawImage(image, x, y, this);
         * For the JScrollPane which will inquire about our size
         * which it needs to properly set its scrollbars.
        public Dimension getPreferredSize()
            return new Dimension(image.getWidth(this), image.getHeight(this));
        private void loadImage(String fileName)
            try
                URL url = getClass().getResource(fileName);
                image = ImageIO.read(url);
            catch(MalformedURLException mue)
                System.out.println(mue.getMessage());
            catch(IOException ioe)
                System.out.println(ioe.getMessage());
    }

  • Scrolling tab page canvase

    hi friends
    i have a problem with my tab page canvase.
    the width of my canvase is very large and i need horizontal scroll bar
    form my canvase,but the horizontal scroll bar of window cannot use forn tab page canvase.
    i appretiate any suggestion.
    thanks.
    shoja.

    Hi puthanampatti,
    Thanks for your reply.
    Here sdi3 means showDetailItem3. I've tried but one error is raised.
    Error is : identifier sdi3 not found.
    My java code is:
    public String showTab() {
    sdi3.setDisclosed(Boolean.TRUE);
    AdfFacesContext.getCurrentInstance().addPartialTarget(sdi3);
    return null;
    i've a showDetailItem(Tab Page) which id is sdi3.
    But error raised.
    How to write it and solve it?

  • Problems creating bass tab in score editor...

    Trying to write some bass tab directly into the score editor for printing out later. First thing I created was a bassline that's only on the low E. When I did the 5th fret A Logic kept putting the note to the open third string A. I fixed that in the tab layout section by setting the A1 pitch to A2 and the note now goes to the 5th fret A like I want.
    But in the next measure I want a B5 bassline on the 7th fret/4th string and 9th fret/3rd string, B and F#. I can get the B no problem, but Logic is forcing the F# to the 14th fret/4th string note instead of the 9th fret/3rd string I want. I've tinkered with changing pitches in the guitar tab layout, but nothing is getting me an F# on the 9th fret/3rd string. Any ideas?
    I wish I could do this in in Finale Notepad, but as far as I can tell, I can't do hammer on/pull off symbols unless I buy the upgrade...things I need to do in the THIRD measure!

    I am sorry to have to say that importing scores was not the reason for MIDI, it is for the MIDI editor only. There is a NEW system now called XML and it can transfer scores and midi, but Logic can only open XML files from SoundtrackPro, Other sequencers,[ Cubase5 ] say they can safely transfer scores but I haven't tried it yet. There is a reply in this forum marked !solved! from me to someone else in which I falsely claim that logic CAN import xml,I was wrong, dig deeper and you will find that the choices for importing are MIDI, ,OMF, Open TL, and AAF, I haven't found any info on what AAF can do, but the other two are only for audio files only. I don't remember Finale exporting AAF so no joy there. Happy searching.

  • PDF Portfolio Navigator with horizontal tab layout

    Hello, Experts
             I am trying to create a PDF Portfolios with horizontal tab layout structure;
             several .NET libraries allowed me to create PDF files with thumbnail layout, but, in order to populate a horizontal tab
             layout, it seems, I would need to create a custom PDF navigator and import it into PDF Portfolio prior to inserting PDF file components ?
            preinstalled navigators look great, but I just need a simple horizontal tab view, where each tab only contains file's name and nothing else;
             buy clicking on each tab - corresponding file would be activated in the viewer
           is there any library of predesigned navigators that I can use ?
            is there any way to extract navigator from one and import it into another PDF portfolio ?
           would I need to use Flash or can this be done via .NET ?
    Best Regards,
    -Alex

    tried to install Portfolio SDK
    can't see the Navigator project wizard in Flex Builder  (  4.6 )
    The plugins have been extracted to:
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse\plugins
    The NavigatorSupport folder has been extracted to:
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse and ( just in case ) to
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\

  • In the last few days, I've encountered a problem with scrolling with my up & down keys. The up & down keys seem to, now function as Home & End keys. MyPage Up & Page Down keys seem to do nothing. What is wrong?

    In the last few days, I've encountered a problem with scrolling with my up & down keys. The up & down keys seem to, now function as Home & End keys. MyPage Up & Page Down keys seem to do nothing. What is wrong?

    Hit the '''F7''' key, you probably have Caret browsing turned on.
    http://kb.mozillazine.org/Accessibility.browsewithcaret

  • Adobe InDesign CC 2014 Custom Panel Built With Extension Builder - Problem: Can't tab from one entry field to the next; Hitting tab instead hides all palettes; Is there a fix? This didn't happen in Adobe Indesign CC

    Adobe InDesign CC 2014 Custom Panel Built With Extension Builder - Problem: Can't tab from one entry field to the next; Hitting tab instead hides all palettes; Is there a fix? This didn't happen in Adobe Indesign CC

    This is planned to be fixed in the next release.

  • Help: Problem with scrolling my html items and placed objects they keep cutting through my top menu

    Basically whenever i place an html item in my Muse site or an object I encounter a problem when scrolling down past that object in the preview. I have a horizontal menu bar that sits on the top of my site and whenever I scroll down the html items and objects
    cut through my menu. Is there any way to rectify this? - i've tried pinning objects but can't figure it out. Any help would be greatly appreciated.
    Thanks,

    So you have a pinned Menu in the Master page but is being overlayed by the objects in page when you scroll down? If that is the case, select the Menu in the Master, right click on it and Move To Master Foreground.
    Thanks,
    Vinayak

  • How to increase the height of a tabbed layout

    How to increase the height of a tabbed layout? I do have a form inside a panelTabbed layout which is not fitting inside.Is there any css class available ?
    Thanks
    Suneesh

    Hi,
    +"My panel tabbed layout is inside a detailStamp facet of a table"+
    you can set the StretchChildren property on the ShowDetailItem components to make the panel tab to resize the contained children. I set the inline style on a paneltab and the result shows in the rendered output
    Frank

Maybe you are looking for