JTabbedPane and its accompanying ChangeListener.

Hi all,
I have a JTabbedPane with two tabs and a ChangeListener. If I click on a single Tab I check in the stateChanged-Method via "((JTabbedPane)event.getSource()).getSelectedIndex()==0" the selected Index of the tab.
This works fine.
But If I generate a PopUp-Event in a selected tab the program branch also in the TabbedPane-Change-Listener and if I check now via "((JTabbedPane)event.getSource()).getSelectedIndex()==0" the selected index is not correct !?
What goes wrong ?
incs

Ok. The problem is solved ! The changelistener-method was access through a refresh event and not through a "chlick-tabbedpane-event".

Similar Messages

  • Enlarge JFrame and its components properties  proportionally

    Hi,
    We have a simple JFrame � Container - uses Flow Layout and has got Buttons, Text Fields� All of them are using Java�s default fonts, sizes..�
    And we want to increase or enlarge all of the JFrame and its sub components properties proportionally (especially Font�.) like in for example MS-Word.
    In the Ms-Word, there is ZOOM option in the Standard tool bar menu. If you set zoom to 150%, the font is automatically increases. And if you set it to 100% the font sets back to normal. And if the window is not enough to fit, it adds the scroll bars.
    For example, if we increase the Labels Font, the height of that component also should increase proportionally. So the Frame also should increase.
    How could we achieve this sort of functionality ( i.e. Proportionally increasing the component�s properties ) in Swing?
    I believe it is hard to set/adjust the all of the Frame�s components properties (I.e. Height, Font�) proportionally by using the Component listeners.
    (Another example, you might have noticed that the Frame�s Font, hight,width �sizes are proportionally bigger in Systems screen�s 800 by 600 pixels mode compare with 1024 by 768 pixels mode. May be this is windows feature. But we are looking at achieving the same sort of feature)
    Any help or thoughts would be appreciated.
    Thanks in advance.
    Vally.

    Here is a working sample:
    package ui_graphics;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.LayoutManager;
    import java.util.Arrays;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSpinner;
    import javax.swing.SpinnerListModel;
    import javax.swing.SpinnerModel;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class ZoomableFrameTest {
       private ZoomablePanel zoomPanel;
       private JLabel label;
       public ZoomableFrameTest() {
          label = new JLabel("Essai pour le zoom");
          label.setBounds(0,0,200,16);
          zoomPanel = new ZoomablePanel();
          zoomPanel.add(label);
          JFrame frame= new JFrame("Zoom test");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.getContentPane().add(getZoomSpinner(), BorderLayout.NORTH);
          frame.getContentPane().add(zoomPanel, BorderLayout.CENTER);
          frame.pack();
          frame.setVisible(true);
       public static void main(String[] args) {
          new ZoomableFrameTest();
       public JSpinner getZoomSpinner() {
          String[] zoomValues = { "50", "100", "150" };
          SpinnerModel model = new SpinnerListModel(Arrays.asList(zoomValues));
          final JSpinner spZoom = new JSpinner(model);
          Dimension dim = new Dimension(60, 22);
          spZoom.setMinimumSize(dim);
          spZoom.setPreferredSize(dim);
          spZoom.setMaximumSize(dim);
          spZoom.setFocusable(false);
          spZoom.addChangeListener(new ChangeListener() {
             public void stateChanged(ChangeEvent e) {
                // R�cup�re le facteur d'�chelle
                int factor = Integer.parseInt((String)spZoom.getValue());
                setScaleFactor(factor);
          spZoom.setValue("100");
          return spZoom;
       private void setScaleFactor(int factor) {
          zoomPanel.setZoomFactor(factor);
    class ZoomablePanel extends JPanel {
       private int zoomFactor;
       public ZoomablePanel() {
          super(null);
       public void setZoomFactor(int factor) {
          this.zoomFactor = factor;
          if (this.isShowing()) this.repaint();
       public void paint(Graphics g) {
          super.paintComponent(g);
          double d = zoomFactor / 100d;
          Graphics2D g2 =(Graphics2D)g;
          g2.scale(d, d);
          super.paint(g2);
    }

  • JTabbedPane and removeTabAt() method

    Hello,
    I use in my application a JTabbedPane and i want allow the user to remove a tab of this JTabbedPane. When the JTabbedPane change i need to perform some traitement.
    So i use a ChangeListener to be informed of all changes of my JTabbedPane.
    But, when i removed a tab which is not in last or first position i'm not informed by the change.
    Thanks for your help.
    Guiguch

    I had the same problem. I fixed it by overriding the remove() method to fire a StateChanged event:
    tabbedPane = new JTabbedPane()
         public void remove(int tab)
              super.remove( tab );
              int after = getSelectedIndex();
              //  The selected tab remained the same after this remove, consider
              //  it a state changed
              if (after == tab)
                   fireStateChanged();
    };

  • How do i find my music that is listed in itunes and is accompanied by a "!"?

    many song on my itunes are not playable and are accompanied by a "!". when i try to play them i get this message:
    The song  xxxxxxxx  could not be used because the original file could not be found. Would you like to locate it?
    how do i locate these songs are restore them to my list?
    i paid for many of them and feel cheated.
    thanks

    If you are positive they are not on your computer try downloading a second time.
    Downloading (using iOS or computer) past purchases from the App Store, iBookstore, and iTunes Store - http://support.apple.com/kb/ht2519 - enabled with iTunes 10.3 and newer; not available in all countries; apps, books (not audiobooks), music, t.v. shows, and movies (some - not all studios have permitted this). Movies currently available in the USA only. Downloading previously purchased movies and TV shows requires iTunes 10.6 or later.  Discontinued items not available. For items not included in the iCloud list (e.g., ringtones), or locations or computer systems where iCloud is not (yet?) available, you only get one download per fee paid.
    Select the store on the left side of iTunes.
    Click on Purchased on the right side under Quick Links.
    You can re-download your available previous purchases.
    i paid for many of them and feel cheated.
    Apple notes it is your responsibility to back up your purchases.  It isn't Apple's job to ensure you always have access to previous purchases, just the way if you lose a CD you cannot go back to the store and expect them to give you another one.

  • [b]HOW TO:[/b]  Copy and Paste THE Filename AND its PATH from Finder

    HOW TO DO THIS: Copy and Paste THE selected Filename AND its entire PATH from Finder to another application as in document footer reference, or document database which has a path field to aid in locating the file later.
    Finder, Spotlight and File Info (can be used to display Path) or using Command F, command I, etc. but user is not allowed to copy the path to clipboard.
    This is rudimentary, yet the word Path, is unknown to Mac Help.
    Message was edited by: jbov

    AJ,
    Isn't it amazing....There is no Command Key for this action? Apple Care was confounded too. And thanx, it'll be a help....
    Jim
    its tedious, but this should work:
    open a terminal window.
    Drag and drop the icon for the file in the terminal
    window.
    This will put the full path including the filename on
    the command line.
    Copy the path from the command line, and paste
    (wherever).
    Close the terminal window.

  • How can i get a comedy, Dutch Treat or/and its companion Detective School Dropouts released in 1987 be included in the iTunes US store for me to down load. i will pay any thing to download them.

    I wish to request that a comedy, Dutch Treat or/and its companion Detective School Dropouts released in 1987 be included in the iTunes US store for me to down load. i will pay any thing to download them.

    You can try requesting it via this page (these are user-to-user forums) : http://www.apple.com/feedback/itunes.html
    But unless the the US rights-holder passes it to Apple and allows them to sell it in the US then Apple won't be able to sell it there

  • Semantics and its' role in Business Services

    Role and importance of semantics in the context of services and SOA:
    Semantics refer to interpretation of information and not the literal definition of information/ data. Applying semantics to information turns it into “knowledge”. Semantics is the act of applying references and drawing conclusions given a set of more scientific informational constructs. Typically semantics are derived using the context in which information is presented. Transposition on the other hand allows applies the rule of inference where in one can draw conclusions on the implication of truth based on some set of facts.
    Read more about this at <a href="http://entarch.blogspot.com/2007/10/semantics-and-its-role-in-business.html">Surekha Durvasula's</a> blog.
    Surekha is an Enterprise Architecture of a large retail company

    Hi shalini,
            Thanks for the reply and can you please say me the menu path for T.code BUSD
    And can u please say the difference between 4.0 and 5.0 versions
    Regards
    Narayana
    Message was edited by:
            manam narayana
    Message was edited by:
            manam narayana

  • What is RID in non clustered index and its use

    Hi All,
    I need help regarding following articles on sql server
    1) what is RID in non clustered index and its use.
    2) What is Physical and virtual address space. Difference in 32 bit vs 64 bit Virtual address space
    Regards
    Rahul

    Next time Please ask single question in a thread you will get better response.
    1. RID is location of heap. When you create Non clustered index on heap and
    lookup happens to get extra records RID is used to locate the records. RID is basically Row ID. This is basic definition for you. Please read
    this Thread for more details
    2. I have not heard of Physical address space. I Know Virtual address space( VAS)
    VAS is simple terms is amount of memory( virtual )  'visible' to a process, a process can be SQL Server process or windows process. It theoretically depends on architecture of Operating System. 32 bit OS will have maximum range of 4 G VAS, it's calculated
    like a process ruining on 32 bit system can address max up to 2^32 locations ( which is equivalent to 4 G). Similarly for 64 bit max VAS will be 2^64 which is theoretically infinite. To make things feasible maximum VAS for 64 bit system is kept to 8 TB. Now
    VAS acts as layer of abstraction an intermediate .Instead of all request directly mapping to physical memory it first maps to VAS and then mapped to physical memory so that it can manage request for memory in more coordinated fashion than allowing process
    to do it ,if not it will  soon cause memory crunch.Any process when created on windows will see virtual memory according to its VAS limit.
    Please read
    This Article for detailed information
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • I lost my iphone4 yesterday..i have find my iphone apps in there and its updated to IOS 5. i wonder if they would be able to still access my accounts in there after i remote locked it.? its offline whenever i checked till now..

    i lost my iphone4 yesterday..i have find my iphone apps in there and its updated to IOS 5. i wonder if they would be able to still access my accounts in there after i remote locked it.? its offline whenever i checked till now.. im wonderin if ist safe coz all my emails are there and all personal info..i hope someone could answer me..i reported to the police the ist step..coz when it happened ..policemen are there..then i went to the nearest MAC center and tried to track it..but its offline..so they asked me if i want to remote lock it..then i did...which i think the mcreason why i cant track my phone beacause its locked?? or not until they connect to wifi or 3g but its unabling them because i locked it..?

    but when i do remote wipe ..it will erase everything in there and i cant track down the phone anyomore?

  • SSO EP 6.0 and ITS

    Hello,
    I try to establish a single sign on connection from our portal to an its instance.
    The portal version is 6.0 SP2 PL31
    The ITS is 6.20 PL 17
    My problem is that when I call a certain transaction via the ITS URL I always get the logon screen...
    When I call a transaction by using the sap transaction starter I am immediately connected without login, but the transaction starter is using the sap gui...
    I set the parameter ~mysapcomusesso2cookie 1 in the global.srvc; when I trace my html stream I can see that the SAP Logon Ticket arrives at the ITS, but I always get the logon screen.
    I searched the forums for similar problems, but could not find a solution...
    thanx for your help
    Philipp

    For what it's worth, I was about to post the very same problem!  The problem also occurs with ITS PL16.  We had this functionality working last year with EP6 SP2 P4 HF6 and ITS 620 PL7 - obviously something has changed in the patches from then until now.
    I have found that using an IAC iView works OK, but trying to use a URL-based iView does not (both portal and ITS server are in the same DNS domain, all the usual stuff). We have to use a URL-based iView because our IAC will not run in an iFRAME as the portal launcher insists on doing.
    - Darren

  • Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verif

    Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verifying and repairing it but had no luck. I also tried mounting and unmounting it but still no solution. Anyone to help please?

    Looks bad. I would strongly advise backing up the stuff on the other two partitions as soon as possible in case the rest of the drive goes wrong.
    Beyond that, Disk Utility has limited abilities to repair disks, DiskWarrior uses a different approach and might, emphasis might be more successful. It has certainly done the job for me in the past when Disk Utility could not.
    See http://www.alsoft.com/diskwarrior/

  • Problems with Syncing iPhone 3G (4.2.1. iOS).  What is appearing in the status bar is "Syncing "untiled playlist.." and its stuck at backing up.  I noticed that my name has been replaced to "untitled playlist". Whats wrong

    Problems with Syncing iPhone 3G (4.2.1. iOS).  What is appearing in the status bar is "Syncing "untiled playlist.." and its stuck at backing up.  I noticed that my name has been replaced to "untitled playlist". Whats wrong

    Welcome to Apple Discussions!
    Maybe a long shot, but WD is not known for the quality of some of their enclosures, although I do like the drives themselves. It may be worth mounting this drive in a different enclosure, something like one of OWC's FireWire enclosures with the highly reliable Oxford chip sets. I wouldn't be inclined to trust a WD enclosure, especially if it already seemed to be acting in a flakey manner.
    Here's an example of what I mean:
    http://eshop.macsales.com/item/Other%20World%20Computing/MEP924FW8E2O/
    I have 3 of these and I really like them.
    From what I understand, if the drive spins up, it is often possible to recover data from it. To be absolutely certain to destroy the data, you just about have to take a hammer to the disk. Hopefully, there will be a way to get your data back.
    Good luck!

  • TS1292 My iTunes  will not work at all I've had 7 different people try it and its still not working

    My iTunes  will not work at all I've had 7 different people try it and its still not working

    Cconnect it to your computer with the latest version of iTunes installed.

  • Display data to edit based on fields and its value defined in internal tabl

    I need to display data in a internal table for editing in a screen.
    you have a internal table with field name , data types and its value. I need to display data in a screen ( sceen painter not in a report) row by row in vrtical format.
    The internal table's structure not fix. you can have any number of fields in the internal table.
    Can you please send me code if it is available with you or send me any senario in SAP if any ...so that i can debug to extract the code..
    have to display data vertically as below in editable format,
    for example,
    Airline
    Flight Number
    Flight date
    Flight price
    Airline Currency
    Plane Type
    Maximum capacity
    Occupied econ.
    Total
    No of fields will change.
    also F4 help needs to be attached with each field.
    I think it can be done through step loop. can anybody give sample code or tell me where to find in SAP or somewhere else?
    it will be great help to me..
    Sanjeev

    Hi
    just check out this program DEMO_DYNPRO_STEP_LOOP.

  • I tried to restore my iphone but when it was restoring it said a problem occurred and now it just shows the itunes symbole and its telling me to connect to it but when i try to it  doesnt show up on my computer

    i tried to restore my iphone but when it was restoring it said a problem occurred and now it just shows the itunes symbole and its telling me to connect to it but when i try to it  doesnt show up on my computer

    Hi there starbaeza,
    You may find the information in the article below helpful.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    -Griff W. 

Maybe you are looking for

  • How can i reset my ipad after forgoten password

    i dont know how to reset my ipad, i forgot my password,i have message (ipad is disabled connect to itune)

  • Error when using Oracle OTD wizard

    I'm getting this message when I try to create an OTD using the oracle otd wizard with Netbeans in Windows. Does anyone know how to resolve this issue? java.lang.NullPointerException      at com.stc.oracle.wizard.TablesVisualPanel.isValid(TablesVisual

  • Tables for Receiver Determination and Receiver agreement

    Hello Experts, Is anyone aware if there is a some table which gets updated whenever we create a receiver determination or receiver agreement in PI. If possible can you guys give me the table names. Thanks in advance, ~ Suraj

  • How to change date format in BR?

    Hi all! Does anybody know how to change date format in BR? I created global variable with type DateAsNumber and usage type run-time promt and used it in BR Then I launched a BR on the form and chose necessary date. Date stored in MM/DD/YYYY format, b

  • BAPI FOR INSPECTION PLAN

    Plz tell me step by step procedure of bapi_inspectionplan_create using LSMW .