How  can i determin which tab has been clicked??

hi there
how do i determine which one of the tabs in a tabbedPane has been clicked? do i add ActionListener to the tabbedPane or its sub JPanel?

I import them all, it finallly compiled, but I am not sure if they are ok. here is the codes
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
TabbedPane = new JTabbedPane();
TabbedPane.addTab("Easy", easyTab);
TabbedPane.addChangeListener(new ChangeListener()
public void stateChanged( ChangeEvent ce )
Object source = ce.getSource();
if (source == "Easy")
currentTab = "easy";
does it look all right to you?

Similar Messages

  • How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

    I store different channels in a TDMS file.
    I like to have a time channel at the first position with group index 1 and number 1.
    When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
    Here are my questions:
    How does DIADEM import TDMS files?
    How gets every channel his number and groupindex?
    How can I determine which channel has which groupindex and number?
    Best regards
    Joerg

    Hi Jörg,
    i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.
    Did you use the library for creating *.tdms files like in the link ?
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file
    when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.
    When you don´t have Labview you can use the 30 days test of current version 8.5 under following link
    german version download link
    https://lumen.ni.com/nicif/d/lveval/content.xhtml
    english version download link
    https://lumen.ni.com/nicif/us/lveval/content.xhtml
    Hope it helps
    Best Regards

  • Dynamic h:commandLinks : how do I know which one has been clicked?

    Imagine I have something like:
    <h:dataTable etc etc>
    <h:column>
    <h:outputText etc etc />
    </h:column>
    <h:column>
    <h:commandLink action="#{BeanName.removeEntry}" />
    </h:column>
    </h:dataTable>
    <h:inputText etc etc><h:commandLink action="#{BeanName.addEntry}" />
    so that when I add Entries, they get seen on the dataTable above..
    THe addEntry code is easy to do, it's only a ArrayList.add() method call but what about the removeEntry? I don't know how to figure out which 'remove' commandLink was clicked.

    If you have a datamodel in yo
    ur datatable, then you can do something like this:
    getModel().getRowData()
    This returns the selected row.
    From here it's with you.....

  • How can I tell which version has been matched?

    I have multiple versions of the same song.  Not duplicates, but remastered versions of the same song.  How do I know which version iTunes has matched?

    Thank you, but that is not the issue.  I am want to know which itunes track with which it is matched.  For instance if I have the the remastered version of a song I want to know if it has been matched to the original or remastered track in itunes.  Because the meta tags stay the same I can't tell from the track info.

  • JRadioButtons - how do i know which one has been clicked?!

    hey all,
    im working on a simple gui to implement a ticket office system. im a bit of a newbie to using GUIs and im fed up of trawling through the api's in search of answers and im on the home run... so here's my q...
    i have a gui class for doing a search for tickets. i have a controller in a seperate actionListener class for this gui. i have three radio buttons for searching for three different things and then there's a search jbutton to start the search.
    how do i know what radio button the user has selected when they click search? i need to be able to know this from the controller, not in the gui itself.
    thanks a mil!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TicketOffice_Demo extends JFrame {
        public TicketOffice_Demo() {
            initComponents();
        private void initComponents() {
            ticketsGroup = new ButtonGroup();
            toolbar = new JToolBar();
            startSearch = new JButton();
            typeA = new JRadioButton();
            typeB = new JRadioButton();
            typeC = new JRadioButton();
            scrollpane = new JScrollPane();
            textarea = new JTextArea();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Ticket Office Demo");
            toolbar.setFloatable(false);
            startSearch.setText("Start Search");
            startSearch.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    startSearchActionPerformed(evt);
            toolbar.add(startSearch);
            ticketsGroup.add(typeA);
            typeA.setSelected(true);
            typeA.setText("\"A\" Tickets");
            typeA.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeA);
            ticketsGroup.add(typeB);
            typeB.setText("\"B\" Tickets");
            typeB.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeB);
            ticketsGroup.add(typeC);
            typeC.setText("\"C\" Tickets");
            typeC.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeC);
            getContentPane().add(toolbar, BorderLayout.NORTH);
            textarea.setBackground(new Color(255, 255, 204));
            textarea.setEditable(false);
            scrollpane.setViewportView(textarea);
            getContentPane().add(scrollpane, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
        private void startSearchActionPerformed(ActionEvent evt) {
            Controller cont = new Controller(ticketType);
            textarea.append("Controller searches for ticket type '"+cont.getTicketType()+"'\n");
        private void typeAItemStateChanged(ItemEvent evt) {
            if(typeA.isSelected()){
                ticketType = "A";
            }else if(typeB.isSelected()){
                ticketType = "B";
            }else if(typeC.isSelected()){
                ticketType = "C";
        public static void main(String args[]) {
            new TicketOffice_Demo().setVisible(true);
        private JButton startSearch;
        private JRadioButton typeA;
        private JRadioButton typeB;
        private JRadioButton typeC;
        private JScrollPane scrollpane;
        private JTextArea textarea;
        private JToolBar toolbar;
        private ButtonGroup ticketsGroup;
        private String ticketType ="A";
    class Controller {
        Controller(String ticketType){
            this.ticketType = ticketType;
        public String getTicketType(){
            return ticketType;
        private String ticketType;
    }

  • How can I determine which image was clicked in 3D carousel?

    I have been modifying some 3D carousel code that I found in hopes that I can get it such that when image "resolv2.jpg" (or any of my other images) is clicked on at the front of my carousel, it goes to a specific webpage. By just replacing "moveBack(event.target) from the toggler section of the code with "navigateToURL:(newURLRequest('http://google.com'), the target DOES sucessfully go to google when clicked on. However, I want to modify this code by altering the else statement to say something to the effect of "else if event.target (clicked on object) is 'resolv2.jpg' THEN go to google". So essentially, my question is how can I determine which image was clicked? Here is the entire code with the area I was altering bolded:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init();" backgroundGradientColors="[#000033, #000033]" backgroundGradientAlphas="[1.0, 1.0]">
    <mx:Script>
              <![CDATA[
    //Import Papervision Classes
                   import org.papervision3d.scenes.*;
                   import org.papervision3d.cameras.*; 
                   import org.papervision3d.objects.*;
                   import org.papervision3d.objects.primitives.*;
                   import org.papervision3d.materials.*;
                   import org.papervision3d.materials.shadematerials.*;
                   import org.papervision3d.materials.utils.MaterialsList;
                   import org.papervision3d.lights.*;
                   import org.papervision3d.render.*;
                   import org.papervision3d.view.*;
                   import org.papervision3d.events.*;
                   import org.papervision3d.core.*;
                   import org.papervision3d.lights.PointLight3D;
                   import flash.filters.DropShadowFilter;
                         import caurina.transitions.*;
                         private var numOfItems:int = 5;
                         private var radius:Number = 600;
                         private var anglePer:Number = (Math.PI*2) / numOfItems;
                         //private var dsf:DropShadowFilter = new DropShadowFilter(10, 45, 0x000000, 0.3, 6, 6, 1, 3);
                   public var angleX:Number = anglePer;
             public var dest:Number = 1;
                   private var theLight:PointLight3D;
            //Papervision Engine
                   private var viewport:Viewport3D; 
                   private var scene:Scene3D; 
                   private var camera:Camera3D;
                   private var renderer:BasicRenderEngine;
             private var planeArray:Array = new Array();
             [Bindable]
             public var object:Object;
             private var arrayPlane:Object;
             private var p:Plane;
             //Initiation function           
             private function init():void 
             viewport = new Viewport3D(pv3dCanvas.width, pv3dCanvas.height, false, true); 
             pv3dCanvas.rawChildren.addChild(viewport); 
             viewport.buttonMode=true;
             renderer = new BasicRenderEngine();
             scene = new Scene3D(); 
             camera = new Camera3D();
             camera.zoom = 2; 
             createObjects(); 
             addEventListeners();
    //Create Objects function          
              private function createObjects():void{
              for(var i:uint=1; i<=numOfItems; i++)
                        /* var shadow:DropShadowFilter = new DropShadowFilter();
                        shadow.distance = 10;
            shadow.angle = 25; */
                        var bam:BitmapFileMaterial = new BitmapFileMaterial("images/resolv"+i+".jpg");
                        bam.oneSide = false;
                        bam.smooth = true;
            bam.interactive = true;
                        p = new Plane(bam, 220, 200, 2, 2);
                        p.x = Math.cos(i*anglePer) * radius;
                        p.z = Math.sin(i*anglePer) * radius;
                        p.rotationY = (-i*anglePer) * (180/Math.PI) + 270;
                        scene.addChild(p);
                        //p.filters=[shadow];
                        p.extra={pIdent:"in"};
                        p.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
            planeArray[i] = p;
              // create lighting
            theLight = new PointLight3D();
            scene.addChild(theLight);
            theLight.y = pv3dCanvas.height;
              private function toggler(event:InteractiveScene3DEvent):void
                            // if the cube's position is "in", move it out else move it back
                            if (event.target.extra.pIdent == "in")
                                    moveOut(event.target);
                            else
                                   moveBack(event.target);
                    private function moveOut(object:Object):void
                              trace(object +" my object");
                            // for each cube that was not selected, remove the click event listener
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.removeEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            //right.enabled=false;
                            //left.enabled=false;
                            // move the selected cube out 1000 and rotate 90 degrees once it has finished moving out
                            Tweener.addTween(object, {scaleX:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "out"
                            object.extra = {pIdent:"out"};
                            // move the camera out 1000 and move it the to same y coordinate as the selected cube
                            //Tweener.addTween(camera, {x:1000, y:object.y, rotationX:0, time:0.5, transition:"easeInOutSine"});
                    private function moveBack(object:Object):void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            // move the selected cube back to 0 and rotate 90 degrees once it has finished moving back
                            Tweener.addTween(object, {scaleX:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "in"
                            object.extra = {pIdent:"in"};
                            // move the camera back to its original position
                            //Tweener.addTween(camera, {x:0, y:1000, rotationX:-30, time:0.5, transition:"easeInOutSine"});
                            //right.enabled=true;
                            //left.enabled=true;
                    private function goBack():void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                    private function rotateCube(object:Object):void
                            //object.rotationX = 0;
                            //Tweener.addTween(object, {rotationZ:0, time:0.5, transition:"easeOutSine"});
              private function addEventListeners():void{
        this.addEventListener(Event.ENTER_FRAME, render);
    //Enter Frame Listener function             
    private function render(e:Event):void{ 
                     renderer.renderScene(scene, camera, viewport);
                     camera.x = Math.cos(angleX) * 800;                                                  
                     camera.z = Math.sin(angleX) * 800;
    private function moveRight():void
              dest++;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
    private function moveLeft():void
              dest--;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
              ]]>
    </mx:Script>
              <mx:Canvas width="1014" height="661">
              <mx:Canvas id="pv3dCanvas" x="503" y="20" width="400" height="204" borderColor="#110101" backgroundColor="#841414" alpha="1.0" backgroundAlpha="0.57"> 
              </mx:Canvas>
              <mx:Button x="804" y="232" label="right" id="right" click="moveRight(),goBack()"/>
              <mx:Button x="582" y="232" label="left"  id="left"  click="moveLeft(),goBack()" />
              </mx:Canvas>
    </mx:Application>

    Your answer may be correct, but I am very much a beginner to actionscript, and I was wondering moreso if it is possible to determine the root/url (i.e. images/resolv2.jpg)? Or even if InteractiveScene3DEvent calls a variable that holds this url? However, specifically, I'm just wondering if the actionscript itself could determine the url in a line of code such as "if object == BitmapFileMaterial("/images/resolv2.jpg"); "? Also, here's a copy of InteractiveScene3DEvent in more detail if you think that will help:
    public class InteractiveScene3DEvent extends Event
                         * Dispatched when a container in the ISM recieves a MouseEvent.CLICK event
                        * @eventType mouseClick
                        public static const OBJECT_CLICK:String = "mouseClick";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OVER event
                        * @eventType mouseOver
                        public static const OBJECT_OVER:String = "mouseOver";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OUT event
                        * @eventType mouseOut
                        public static const OBJECT_OUT:String = "mouseOut";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_MOVE event
                        * @eventType mouseMove
                        public static const OBJECT_MOVE:String = "mouseMove";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_PRESS event
                        * @eventType mousePress
                        public static const OBJECT_PRESS:String = "mousePress";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_RELEASE event
                        * @eventType mouseRelease
                        public static const OBJECT_RELEASE:String = "mouseRelease";
                         * Dispatched when the main container of the ISM is clicked
                        * @eventType mouseReleaseOutside
                        public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
                         * Dispatched when a container is created in the ISM for drawing and mouse interaction purposes
                        * @eventType objectAdded
                        public static const OBJECT_ADDED:String = "objectAdded";
                        public var displayObject3D                                        :DisplayObject3D = null;
                        public var sprite                                                            :Sprite = null;
                        public var face3d                                                            :Triangle3D = null;
                        public var x                                                                      :Number = 0;
                        public var y                                                                      :Number = 0;
                        public var renderHitData:RenderHitData;
                        public function InteractiveScene3DEvent(type:String, container3d:DisplayObject3D=null, sprite:Sprite=null, face3d:Triangle3D=null,x:Number=0, y:Number=0, renderhitData:RenderHitData = null, bubbles:Boolean=false, cancelable:Boolean=false)
                                  super(type, bubbles, cancelable);
                                  this.displayObject3D = container3d;
                                  this.sprite = sprite;
                                  this.face3d = face3d;
                                  this.x = x;
                                  this.y = y;
                                  this.renderHitData = renderhitData;
    Thank you so much!

  • How can I determine which computer a share is connected to in /Volumes from terminal or a script?

    I run a set of virtual machines via Fusion on an iMac that we run automated tests on for our website.  There is a folder on each VM called /Automation that is shared. 
    I have a python script that runs on the host, that will find an open VM, start it up and then mount the VM's /Automation folder.  So if there is only 1 VM powered on, the folder shows up in /Volumes as /Volumes/Automation.  The  problem is when there are 2 or more VM's powered on, because then the shares start being named /Volumes/Automation-1 and Automation-2 etc.  So my question is, how can I determine which computer each share belongs to from terminal or a script?
    In other words, I'm looking for something like:
    /Volumes/Automation = "FirstVirtualMachineName.local"
    /Volumes/Automation-1 = "SecondVirtualMachineName.local"
    Is there any way to determine which computer a mounted share is connected to?  In the past, I've just unmounted all /Automation folders, and then mounted them in a particular order, but that's unreliable and messy in my opinion.  If anyone knows a better way, please let me know.  Any help is appreciated.
    Thanks,

    Well I think I have a workable solution.  It's not perfect, but I think it will do the trick. I can put a spotlight comment on the folder similar to 'HostName=OSX-Automation-1.local' and can then retrieve that value from our server with the following python snippet:
    import subprocess
    out,err = subprocess.Popen(['osascript','-e','tell application \"Finder\" to get comment of \"Macintosh HD:Volumes:Automation-1\"'],stdout=subprocess.PIPE, stderr=subprocess.PIPE).communciate()
    So I could just loop through each 'Automation*' folder in /Volumes and grab the name from the spotlight attributes on the directories.  I don't think I really need to worry about the comments being overwritten, but I may have one of our launch daemons that run on the VM check that spotlight comment once a minute or something to ensure that the correct value is there.
    If it ends up not working well in practice, I'm going to give your suggestion about a config script a shot.  It would require a little more up front work, but seems as if it would be pretty solid after that. 
    Thanks again for helping me think it through

  • I have about 5,000 images in a Folder.  How can I determine which images are NOT in a Collection?

    I have about 5,000 images in a Folder.  How can I determine which images are NOT in a Collection?

    Create a smart collection with criteria "collection" and "does not contain"; and also with criterion Folder contains (or folder contains all)
    That works if you are thinking about a specific named collection.
    If you are interested in finding photos that are not in ANY collection, the usual trick is "collection" "does not contain" "a e i o u y"

  • How can I determine which machines have activated Adobe Acrobat Standard 9?

    How can I determine which machines have activated Adobe Acrobat Standard 9?

    Hi jrector3,
    You need to go to the respective machines and launch Acrobat and check if it prompts for serial number.
    You can also go to the help menu and check if 'Deactivate' option is highlighted.
    Regards,
    Rave

  • How do I know which block has been changed in Master/Detail

    Hi,
    I have master detail blocks. How do I know which block has been changed?
    I used :SYSTEM.FORM_STATUS. It only gave me "Changed" or "Query". but didn't tell me which block has been changed in MASTER or DETAIL.

    I believe if :system.form_status != 'QUERY' you'll need to loop through through the blocks checking :system.block_status to see who changed. Of course you'd have to go_block() before checking the status.

  • How can I see which pictures have been backed up

    How can I see which pictures have been backed up

    All the pictures in your camera roll will be backed up in iTunes or iCloud (depending on whether you have iCloud backup enabled on your iPhone) every time a backup is performed. The other photos stored on your iPhone (i.e. the ones you didn't shoot using the iPhone itself) will NOT be backed up.
    Nevertheless, it can't hurt to import them into iPhoto or Aperture (or whatever you're using) as roaminggnome suggested.

  • How can I determine which generation my iPod is?

    How can I determine which generation my IPod touch is? I have a new sound system that is only compatible with 5th gen. When I went out to add this device to the support community's list of my devices, it only gave me ipos 5 to add. Can I rely on this?

    Identifying iPod models
    The 5G is the first iPod to have the taller screen and the small Ligntning dock connector vice the large 30 pin connector

  • How can I determine which profile Firefox 5 is currently using?

    How can I determine which profile Firefox 5 is currently using?

    in address bar type:
    '''''about:cache'''''
    and look at '''''Offline cache device -> Cache Directory'''''

  • How can I determine which generation ipad I have?

    how can I determine which generation ipad I have. It was a gift last year.

    Click here for information.
    (73309)

  • How can I determine which generation my Apple TV device is ?

    How can I determine which generation my Apple TV device is?

    Models
    1st generation
    2nd generation
    3rd generation
    3rd generation Rev A
    Release date(s)
    January 9, 2007
    September 1, 2010
    March 7, 2012
    January 28, 2013
    Discontinued
    September 1, 2010
    March 7, 2012
    March 10, 2013[69]
    In production
    Model Number - Model ID - Order Number
    A1218 - AppleTV1,1 - MA711LL/A
    A1378 - AppleTV2,1 - MC572LL/A
    A1427 - AppleTV3,1 - MD199LL/A
    A1469 - AppleTV3,2 - MD199LL/A

Maybe you are looking for