Close icon display for a Tab(ShowdetailItem)

Hi,
I am using the PanelTab with multiple ShowDetailItems. I am giving the close icon provision for the showdetail item. But the close icon is coming only in mouse over.
I need to display the close always(ShowDetailItem).
Reg,
Brahma B

There is a tutorial for JScrollPane:
http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html
It came to my mind that JSplitPane is not using JScrollPane for the two components you add. So perhaps the solution would be to "wrap" both your components to their own JScrollPane before you add them to the split pane.
Then for those scroll panes I would probably use:
JScrollPane.setColumnHeaderView(myXCloseButtonInAPanel)
or
JScrollPane.setCorner(upperRightCorner, myXCloseButton)
I don't know if that will work, or how it will look like now that you use the scroll pane's scrollbars instead of the split pane's scroll bar. You have to experiment with it. The scroll pane's should be able to resize themself to fit in the split panes areas when you move the divider, and maybe that's not so easy to do. Otherwise you will end up with both a scrollbar from the split pane and a scroll bar from the scroll pane.. yuck.
Maybe someone else has a better solution?

Similar Messages

  • Setting Close icon (X) for a container

    Hi,
    I just want to know whether it is possible to set close icon (X) for a panel or any other component. Here close icon mean the one which we see on the top right cornet of a IE window.
    Thanks in advance.
    Sapna

    There is a tutorial for JScrollPane:
    http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html
    It came to my mind that JSplitPane is not using JScrollPane for the two components you add. So perhaps the solution would be to "wrap" both your components to their own JScrollPane before you add them to the split pane.
    Then for those scroll panes I would probably use:
    JScrollPane.setColumnHeaderView(myXCloseButtonInAPanel)
    or
    JScrollPane.setCorner(upperRightCorner, myXCloseButton)
    I don't know if that will work, or how it will look like now that you use the scroll pane's scrollbars instead of the split pane's scroll bar. You have to experiment with it. The scroll pane's should be able to resize themself to fit in the split panes areas when you move the divider, and maybe that's not so easy to do. Otherwise you will end up with both a scrollbar from the split pane and a scroll bar from the scroll pane.. yuck.
    Maybe someone else has a better solution?

  • Help with disabling close icon of last opened tab in JTabbedPane

    Hello
    Would someone help me out ? I have 3 tabs opened in a JTabbedPane, each with close icon "X". I am looking for a way to tell my program: if the user closes 2 tabs and only 1 remain, disable the close icon "X" of the last opened tab so that the user is unable to close the last tab. I have searched the forum, most I have run into are how to create the close icon. Would someone give me some insight into how to go about doing this? or if you have come across a forum that discusses this, do please post the link. Also, I am using java 1.6.
    Thanks very much in advance

    On each close, look how many tabs are remaining open in the JTabbedPane (getTabCount).
    If there is only one left, set its close button to invisible. Something like this:
    if (pane.getTabCount() == 1) {
        TabCloseButton tcb = (TabCloseButton) pane.getTabComponentAt(0);
        tcb.getBtClose().setVisible(false);
    }

  • Capture Close icon event for ADF dynamic UI shell

    I am using Oracle ADF dynamic TAB UI shell template to build
    the application.
    I have two option to close Employee TAB on right side , one
    is “Remove Tab” highlighted in Navigation pane and second is close icon in
    right most corner of tab page.
    Now while closing the tab page I want to invoke one method
    or task. In Remove Tab  I am able to do this by managed Bean (writing the
    method into bean and invoke that method in Command link of Navigation pane).
    But here the challenge is to invoke same method while
    closing the Tab by close icon. Therefore I want to capture the event and call
    this method.
    Please let me know if you can share any idea on this.
    When clicked on Remove tab I am getting popup message
    successfully while changing the name SMITHR from RITESH.

    Hi,
    In this thread you have some ideas
    UI Shell - how to allow ADF Library Bounded Task Flow to close itself

  • When running Firefox with normal view with bookmarks and tabs the display for the tab is jumping up and down about 1/4 of inch - display is ok if used in full screen but when go back to normall havers again. this ony started happening last night after

    Am having problems with display hovering in open tabs. I used Full screen last night when browsing for first time and since then when I go back to normal view the window shakes up and down about 1/4 inch and have to go to full screen for steady view. The toolbars are all steady it is only the web page.
    == This happened ==
    Every time Firefox opened
    == Last night after using full screen.

    Do you have any saved bookmarks on the Bookmarks Toolbar, or that that Toolbar empty and you have it being displayed??
    Try opening View > Toolbars and click on the Bookmark Toolbar item to remove the check-mark, and then see how that affects that "jumping" or vertical oscillation of the UI.
    If that doesn't solve your problem, you can try the Firefox SafeMode and verify that problem doesn't exist in that troubleshooting mode.
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    If it is gone in SafeMode, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Tab control shows wrong display for selected tab

    My computer crashed when I tried to post this earlier, so I apologize if the first post actually shows up. 
    I have seen this for years so it is nothing new, but I don't remember seeing it in any release notes (sorry if I missed it).
    Upon loading the .vi (or as an executable), the .vi shows the wrong page for the selected tab.  After selecting a different tab, the control works fine.  Also, if you create a property node to read the tab value, it matches the displayed page....just the selected tab seems to be incorrect.
    A work around is to select the default tab before saving the .vi, but why is this happening in the first place?
    Attachments:
    tab_example.vi ‏24 KB

    Hi Stephen,
    The erroneous tab display is something I see on most of not all of my code that uses a tab control (each is a typedef). 
    What change would I make the the typedef?  If I disconnect the tab from the typedef then I will loose the advantages of using the typederf...I will stick with the workaround like I have for the past 3+ years.
    Isn't this a LabVIEW bug since the displayed tab is not equal to the value read from the control?  I have not tried it on this example I posted but in the past, writing to the control does not fix the displayed tab (writing the control may not work since I wrote the same value that LabVIEW thinks is the current value, but the displayed!=actual).
    Thanks,
    Todd

  • 2G Nano Windows XP locked icon displayed for hold button

    My iPod displays the lock icon in the upper left hand corner of the screen even though my lock button is not slid over to "Lock" Activating and deactivating the lock key does not unlock, I have attempted to reset by pressing the menu and play (and the menu and select) keys, I have Restored my iPod and it says it is updated but the thing is still locked! Please help.

    No, it doesn't unlock... and reset and restore don't work either. sighs This is such a shame, I thought this thing was awesome, and I can't think what I've done that it would do this. now I have to be separated from it? sniffles lol Darn.

  • Icon display for call forwarding?

    I would love this also.  Using Droid Razr...
    <Branched to a new discussion for more exposure.>
    Message was edited by: Verizon Moderator

    There's a couple of apps in Google Play; have not used one, so can't recommend, though.

  • JTabbed Pane close icon help

    Hi
    I am trying to create a close icon on my JTabbedPane tabs, so i wrote an closeiconTab class extedning Icon and implements MouseListener, whenever a click is observered, i kill the a tab.
    But this method gives me an arrayoutofbound exception error, after debuggin, i realize my implemention goes against the single thread rule for swings. Anyone know a way around this ???
    I've tried this
        public void mouseClicked( MouseEvent e )
            if( _bounds.contains( e.getX(), e.getY() ) )
                 SwingUtilities.invokeLater(new Runnable() {
                     public void run() {
                          _parentTabbedPane.remove( _tabbedComponent );
        }but it still doesnt work

    does the mouse click call the listener? If so, just call the remove method without the SwingUtilities method part.

  • JTabbedPane with one close button for all tabs

    Hello,
    there have several solutions been posted for JTabbedPane subclasses that provide tabs with icons working as close buttons on each tab. I think this is not user friendly because the user can hit the close button accidentally when selecting a tab. And a "really close?" dialog is clumsy.
    Therefore I prefer the Netscape browser style: There's only one close button rightmost of the tabs that closes the selected tab. But I don't have an idea how to achieve this.
    Does anyone have a solution or an idea? Thanks in advance for help.

    This solution has been posted several times and is not what I wanted. But I rewrote the thing so that
    - the close buttons are on the right hand side of each tab so that it is conformant with Eclipse style, and
    - the close buttons work only with a left click (see code below).
    I just wonder how I can move the text a little bit to the left so that the appearence is a bit more balanced. Can someone help, please?
    import java.awt.Color;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    class TabbedPaneCloseButtonUI extends BasicTabbedPaneUI {
        public TabbedPaneCloseButtonUI() {
            super();
        protected void paintTab(
            Graphics g,
            int tabPlacement,
            Rectangle[] rects,
            int tabIndex,
            Rectangle iconRect,
            Rectangle textRect) {
            super.paintTab(g, tabPlacement, rects, tabIndex, iconRect, textRect);
            Rectangle rect = rects[tabIndex];
            g.setColor(Color.black);
            g.drawRect(rect.x + rect.width -19, rect.y + 4, 13, 12);
            g.drawLine(
                rect.x + rect.width -16,
                rect.y + 7,
                rect.x + rect.width -10,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -10,
                rect.y + 7,
                rect.x + rect.width -16,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -15,
                rect.y + 7,
                rect.x + rect.width -9,
                rect.y + 13);
            g.drawLine(
                rect.x + rect.width -9,
                rect.y + 7,
                rect.x + rect.width -15,
                rect.y + 13);
        protected int calculateTabWidth(
            int tabPlacement,
            int tabIndex,
            FontMetrics metrics) {
            return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + 24;
        protected MouseListener createMouseListener() {
            return new MyMouseHandler();
        class MyMouseHandler extends MouseHandler {
            public MyMouseHandler() {
                super();
            public void mouseReleased(MouseEvent e) {
                int x = e.getX();
                int y = e.getY();
                int tabIndex = -1;
                int tabCount = tabPane.getTabCount();
                for (int i = 0; i < tabCount; i++) {
                    if (rects.contains(x, y)) {
    tabIndex = i;
    break;
         if (tabIndex >= 0 && ! e.isPopupTrigger()) {
    Rectangle tabRect = rects[tabIndex];
    y = y - tabRect.y;
    if ((x >= tabRect.x + tabRect.width - 18)
    && (x <= tabRect.x + tabRect.width - 8)
    && (y >= 5)
    && (y <= 15)) {
    tabPane.remove(tabIndex);
    import java.awt.BorderLayout;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTabbedPane;
    public class TabbedPaneWithCloseButtons {
    JFrame frame;
    JTabbedPane tabPane;
    public TabbedPaneWithCloseButtons() throws Exception {
    frame=new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    tabPane=new JTabbedPane();
    tabPane.addTab("test1xxxxxxxxxxxxxx", new JLabel("1"));
    tabPane.addTab("test2xxxxxxxxxxxxxxxxxxx", new ImageIcon("images/icon.gif"), new JLabel("2"));
    tabPane.addTab("test3xxxxxxxx", new JLabel("3"));
    tabPane.setUI(new TabbedPaneCloseButtonUI());
    frame.getContentPane().add(tabPane);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200,200);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args) throws Exception {
    TabbedPaneWithCloseButtons test=new TabbedPaneWithCloseButtons();

  • Dynamic Tab UI Shell: controlling the Close icon

    Hi,
    When I open dynamic Tab in page, along with the Tab, close icon will appear to close the Tab.
    By default I have to show a Tab that should not be closed at any time.
    Could anybody suggest how to implement this?
    Thanks,
    Vinod

    The source code for the UI Shell is available here (search for .zip in the page): http://www.oracle.com/technetwork/developer-tools/adf/uishell-093084.html
    Basically make your own cut of the shell, and add whatever functionality you want to the page template.
    CM.

  • Excise Invoice Tab is not displaying in MIGO Display for 541 material docs.

    Dear All,
    Excise Invoice Tab is not getting displayed in MIGO Display for 541(Transfer posting to Vendor) material documents.
    I did tranfer posting of some raw materials to the Vendor in MB1B with the movement type 541
    and after that i have created a Subcontracting Challan with the reference of the above created transfer posting
    material document. 
    Now i need the Sub contracting challan number to be displayed in the Excise Tab of the transfer posting material document.
    But if i display the Transfer posting material document in MIGO, the Excise Tab is not getting displayed.
    Kindly help on this so that i can view the Sub contracting challan number in the display of the respective Trasfer posting material document in MIGO.
    Thanks & Regards.

    Pls confirm if you are following the SC process sequence :
    u2022     Creation of Subcontracting PO, here in conditions tab maintain the price (Subcontracting charge) (ME21N)
    u2022     Transfer Posting of Components to Subcontractor ( Movmt Type - 541) (MB1B/ME2O/MIGO)
    u2022     Creation of Subcontracting Challan w.r.t. Transfer Posting Doc (J1IF01) - This challan will have the details normally company needs, in case client need more ... ABAPer have to develop customized smart form
    u2022     Goods Receipt w.r.t. Subcontracting PO and Refer Subcontracting Challan at the time of GR (MIGO) {GR with 101 and auto consumption of components with 543 movement}
    u2022     Reconciliation of Subcontracting Challan (J1IFQ)
    u2022     Completion of Subcontracting Challan (J1IF13)
    u2022     Generation of Annexure IV (J1IFR

  • When closing Firefox windows, I would like a warning before the last window closes. The about:config settings do nothing. There is a warning for multiple tabs..

    When closing Firefox windows, I would like a warning before the last window closes. The about:config settings do nothing. There is a warning for multiple tabs... why not for the last window? I do not use tabs... just windows... I have a mouse button programmed for that. It is really irritating to have to restart Firefox all the time and then open the history window because no warning was issued!

    This is ridiculous. I've had this problems for years now and I'm finally walking away from Firefox. I use my keyboards more than my mouse, and how many times does your finger slip and hit Command Q instead of W. How come FF can't reset something as trivial as this? So many people are having problems with this?
    Feels like FF has become too big, too slow and just not cooperative anymore. What a shame, I've been using Netscape/Firefox for 13 years. This is silly.

  • Calendar Tile on Windows 8.1 displaying incorrect date for icloud calendar but date icon displays correct date on iPhone 5 and iPad Air

    Calendar Tile on Windows 8.1 displaying incorrect date for icloud calendar but date icon displays correct date on iPhone 5 and iPad Air.  Date on Windows 8.1 is correct.  Thank you.

    Try doing  a reset on your phone. Sounds like your carrier's time set is not getting through to your device. If the reset doesn't do it, then go to Settings>General>Reset>Reset Network Settings. That should do it.

  • How can I create an icon for "New Tab" (not "new window") on the toolbar?

    I want to have an icon for New Tab on the toolbar. I cannot find such icon on the Customize option.
    Is this possible?
    BTW I tried to check options-->tabs-->open new windows in a new tab instead, but this does not help and when clicking the "new Window" icon on the toolbar, indeed a new window - and not a new tab - opens.
    Thanks.

    You can open the Customize window and drag the New Tab (+) button form the tab bar on another toolbar. It will become a regular New Tab toolbar button.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"

Maybe you are looking for

  • Function Module for GL Open Items

    Could any body from forum tell me that "there is any Function Module for General Ledge open Items". Rgds, Raju

  • How to view data of a structure.

    Dear all I am a end user. I have access of tcode se16 which allow us to view data from table. But information like long text in PR is stored in a structre. How we can view data stored in a structure. for ex Long text data of PR is stored in a structu

  • Green screen will not respond

    i got green screen ipod will not even turn off some one help plz

  • Group Policy - File Copy

    I have a batch file that I  need to copy to all workstations. I am trying to avoid having to create a startup or logon script to accomplish this. In Group Policy under computer configuration>Preferences>Windows Settings>File I see there is an option

  • How are static methods handled in a multithreaded application?

    hi i have a class Drawer with a static method public static draw(Graphics g). now assume there are more thrads callin at the same time Drawer.draw(g). What happens? have some threads to wait until the others have finished calling the method, or can s