How to get what was typed on a window which is inside another window

Hey guys!
I'm having a problem, i have created a program and when you click on a certain button a small window appears which was created from a class that i named Window...anyway this small window asks for a name, but somehow i can't send what was written in that window to the program that contains the main window...
i've tried creating a method in the class Window, which is called public String returnName(){ return, name;} but this doesn't return anything.
i hope you guys understand what i'm trying to say, if you do, any ideas of how i could do this???!!
-O.D.

this is the class Name1Window:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.JTextField;
public class Name1Window extends Frame implements ActionListener, WindowListener
     Label name;
     TextField txName;
     Button ok;
     Panel Pnl, PnlName, PnlOk;
     private String n;
     private String ln;
     public Name1Window()
          n= "";
          ln="";
          setSize(200,110);
          setTitle("Search");
          Pnl= new Panel();
          Pnl.setLayout(new GridLayout(2,1));
          PnlName= new Panel();
          PnlName.setLayout(new GridLayout(2,2));
          PnlOk=new Panel();
          PnlOk.setLayout(new GridLayout(1,1));
          name= new Label("Name");
          txName= new TextField(10);
          ok= new Button("OK");
          PnlName.add(name);
          PnlName.add(txName);
          PnlOk.add(ok);
          Pnl.setBackground(new Color(161, 187, 241));
          Pnl.add(PnlName);
          Pnl.add(PnlOk);
          add(Pnl);
          ok.addActionListener(this);
          addWindowListener(this);
     public void actionPerformed(ActionEvent e)
      {//If the user clicks ok:
           if(e.getSource()==ok)
                String n1, ap1;
               n1= txName.getText();
               //calls the method save name and sends whatever was typed in txName:
               saveName(n1);
                dispose();
     public void saveName(String n2)
          this.n= n2;
          //If you write a System.out.println(n) it WILL print what was typed!!
           public String returnName()
          return n;//It's gonna return a " "
           public void windowClosing(WindowEvent e)
           //It exits the small window; Name1Window
           dispose();
            public void windowOpened(WindowEvent e){}
      public void windowClosed(WindowEvent e){}
      public void windowActivated(WindowEvent e){}
      public void windowDeactivated(WindowEvent e){}
      public void windowIconified(WindowEvent e){}
      public void windowDeiconified(WindowEvent e){}
}

Similar Messages

  • How to get the global location of a component which is inside some containers.....

    Hai,
    I have a texInput component,which is placed inside containers like following
    1) Bordercontainer start....
    2) Vbox start...............
    3) Hbox start..............
    ..........Here My TextInput.........
    3) Hbox end..............
    2) Vbox end...............
    1) Bordercontainer end....
    Now after initialization i want to get the location of my textInput with respect to Application.
    I tried with with localToGlobal(PointofLocalCoridnate), then it is not giving the correct location of textInput..Please suggest me....
    Thank you...

    What are you calling localToGlobal on?  It should be on the parent of the TextInput itself

  • I had an apple ID which I used for iCloud.  I upgraded the iCloud account and changed the apple ID to a @me address. Now I can't view what was in my original apple ID account.  How can I get what was stored on the original account?

    I had an Apple ID which I used for iCloud.  I upgraded the iCloud account and changed the apple ID to a @me address. Now I can't view what was in my original apple ID account.  How can I get what was stored on the original account?

    cathorio wrote:
    I recently changed my lap top. My problem is the new lap top won't accept my apple I D it asked me to sing up for a new one which I did.
    I am puzzled by this. The laptop doesn't need the Apple ID - but iTunes does. I could be missing something but ....
    Why would you not be able to use your existing Apple ID and iTunes account on a new laptop? If you authorized the computer - you should be able to use your existing account - unless you already had 5 computers authorized with the existing ID - and that was why iTunes would not accept the ID. However, I'm sure that you would have received a popup message from iTunes telling you that you had reached the limit.
    I just received a new MBP and my daughter did as well. My entire family shares an Apple ID and we had no issues at all with my Apple ID and iTunes on our new computers and I did not have to sign up for a new account. Did you even try the old ID?

  • How to get WHAT U HEAR option for PCI Express X-Fi Titanium sound card and Windows 7

    how to get WHAT U HEAR option for PCI Express X-Fi Titanium sound card and Windows 7 ? Is it on the basic driver? or do you have to install some other software?
    jane

    You have to install the rest of the software(s) for the sound card. The software is (if it is with the installation CD, though) called "Creative Smart Recorder" or something like that.

  • How to Reference What Was Clicked in a TileList using an ItemRenderer

    Hi,
    I've got a Tilelist and I'm using an ItemRenderer, which is a Button.
    I don't understand how to reference what was clicked. So, if the first tile (which is the first Obect) is clicked, how do I know that that particular one was clicked.
    <mx:TileList 
        id="myTL"
        dataProvider="{myAC}"
        width="400"
            height="400"
            columnCount="2"
            rowCount="2" />
    <mx:ArrayCollection id="myAC">
        <mx:Array>
        <mx:Object id="first" label="1" />
        <mx:Object label="2" />
        <mx:Object label="3" />
        <mx:Object label="4" />
        </mx:Array>
    </mx:ArrayCollection>
    ItemRenderer:
    <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
    click="Alert.show( 'This was Clicked')">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    ]]>
    </mx:Script>
    </mx:Button>
    Thank you.
    -Laxmidi

    Hi Laxmidi,
    Using the itemClick event you can acheive this using the event Object. Check the sample code below:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.events.ListEvent; 
    import mx.controls.List; 
    import mx.controls.Alert; 
    import mx.events.ItemClickEvent; 
    private function onItemClick(event:ListEvent):void
    var strAlert:String = "Item Row Index Clicked : " + event.rowIndex + "\n";strAlert +=
    "Item Column Index Clicked : " + event.columnIndex + "\n";Alert.show(strAlert);
    ]]>
    </mx:Script>
    <mx:TileList id="myTL" dataProvider="{myAC}" itemClick="onItemClick(event)" width="400" height="400" columnCount="2" rowCount="2">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" click="Alert.show( 'This was Clicked')">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;]]>
    </mx:Script>
    </mx:Button>
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    <mx:ArrayCollection id="myAC">
    <mx:Array>
    <mx:Object id="first" label="1" />
    <mx:Object label="2" />
    <mx:Object label="3" />
     <mx:Object label="4" />
     </mx:Array>
     </mx:ArrayCollection>
     </mx:Application>
    You can also try this by writing the Click event on the Button in the TileList itemRenderer as well where you can access easily the data of the itemClicked easily using the data Object.
    Thanks,
    Bhasker

  • How to get the specific name of the workset which is currently selected by the user in sap portal 7.0

    Dear Expert,
    I have one requirement like to read the selected workset name in portal by the current user.I have read two documents regarding how to retrieve the PCD contents (iViews, Pages, Worksets and Roles) and its properties like Created by, Changed by, Last changed by and others using PCD API.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5fc4b?quicklink=index&overridelayout=true
    But I am not able to understand how to get the specific name of the workset which is currently selected by the user.Can you please help me.
    I am using portal 7.0.
    Thanks & Regards,
    Patralekha

    Hi Expert,
    I found that we can use Interface INavigationHelperService to read Portal Role selected by user at runtime from http://scn.sap.com/thread/52194
    But this class is available in SAP NetWeaver 7.30 Enterprise Portal .
    But in SAP NetWeaver 7.0 Enterprise Portal that interface is not available.
    INavigationService is available there.
    But didn't get any proper discussion on this interface for the same requirement.
    Can you please help me.
    Thanks & Regards,
    Patralekha

  • I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want

    I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want. How would I do that?

    Pct,
    In the Numbers spreadsheets window where all your documents are shown as icons, tap the Plus Sign.
    Choose Create Spreadsheet
    Select the template you want to use
    Jerry

  • How to get indesign from iMac to mac powerbook which does not have cd slot?

    how to get indesign from iMac to mac powerbook which does not have cd slot?

    That will not work!
    You cannot copy or migrate Adobe applications from computer to computer. There are a whole host of files in different locations which have to be installed, and copying will not do it.
    In fact, you'll now have to use the Adobe Cleaner tool to remove the mess you created. You can get to it here:
    Use the CC Cleaner Tool to solve installation ... - Adobe

  • How to tell what was the latest patch installed on VMware ESX Server 3i, 3.5.0, 207095

    Hello Guys,
    I have been running an old server that was installed as a test system on a DELL workstation - Optiplex GX620 (32 bit).
    During the installation I had to confirgure the file: /usr/lib/vmware/installer/Core/TargetFilter.py to change the following line:
    "return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_IDE" to read:
    "return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_ISCSI" this made it worked and I have been using it for 3 years now. However, at this time I was hoping to update it with the latest patches and updates and I cannot figure out if I have ESXi or just ESX, nor what was my last update and what is required next.
    I have used this command to get the following output:
    # vmware -v
    VMware ESX Server 3i 3.5.0 build-207095
    ... I believe the 3i indicates that I have an ESXi 3.5.0 but is build-207095 the same buid as ESXi 3.5.0 Update 5?
    If not, how do I go about updating it? What is the KB # I should download?
    I can manage it using vSphere Client 5.5 and I can SSH into it using Putty.
    Note: When I run... "# esxupdate --bundle=ESXe350-201302401-I-SG.zip update" from within the folder where its at in the datastore, nothing happens... just a new line is scrolled.
    Also...
    # esxupdate query
    <?xml version="1.0"?>
    <query-response>
      <installed-packages>
        <package ID="ESX-207095">
          <name>firmware</name>
          <version>3.5.0</version>
          <rel>207095</rel>
        </package>
        <package ID="ESX-CLIENT-204907">
          <name>viclient</name>
          <version>2.5.0</version>
          <rel>204907</rel>
        </package>
        <package ID="ESX-TOOLS-207095">
          <name>tools</name>
          <version>3.5.0</version>
          <rel>207095</rel>
        </package>
      </installed-packages>
    </query-response>
    /vmfs/volumes/525300ce-5ff6ad3d-e2ed-0014222aedb7/Patches/ESXe350-201302401-O-SG #
    ... is there any further update for this system? I believe so as the Heartbleed patch etc. was not around when I was installing this server back in 2010.

    Hello Richardson Porto,
    I wanted to tell you that I appreciate the help so far.
    Also wanted to point out to you, that the KB indicated above is older than Update 5, which from your instructions is what I have installed. That KB is for U2.
    Now, the document definitely has step by step instructions on installing, querying etc. But my problem is ... NOT ALL COMMANDS WORK FOR ME!
    This is why I am here because all the instructions I have been reading does not work with my flavor of ESX 3.5.0, 207095... WHY? It has me stumped.
    For example, here are some commands the doc asked me to do and they failed: (Note that I had to unzip the folder on my windows box and upload it to /tmp using vSphere Client)
    /tmp # ls
    ESX350-201302402-BG      ESX350-201302402-BG.zip  vmhsdaemon-0
    /tmp # unzip ESX350-201302402-BG.zip
    -ash: unzip: not found                                                                                          -----------------------THIS COMMAND WAS NOT FOUND ?
    /tmp # cd ESX350-201302402-BG
    /tmp/ESX350-201302402-BG # esxupdate info
    Invalid command info                                                                                          -----------------------THIS COMMAND WAS INVALID ?
    /tmp/ESX350-201302402-BG # esxupdate update                                       -----------------------NOTHING HAPPENED HERE ?
    /tmp/ESX350-201302402-BG # ls -lh
    -rw-------    1 root     root       321.3k Dec 13 15:24 VMware-esx-scripts-3.5.0-988599.i386.rpm
    -rw-------    1 root     root         1.6k Dec 13 15:24 contents.xml
    -rw-------    1 root     root          701 Dec 13 15:24 contents.xml.sig
    -rw-------    1 root     root         1.4k Dec 13 15:24 descriptor.xml
    drwxr-xr-x    1 root     root          512 Dec 13 15:24 headers
    /tmp/ESX350-201302402-BG #
    NOTE: All these commands were run sequentially and I just copied and paste it from my SSH Client (PuTTy.exe)
    Is there a toolkit I need to install to have these commands or what really am I missing here? Host is in Maintenance Mode and the 1 VM that's on it is off!
    I am going to start a new discussion with this NEW ISSUE, since the Heading of this DISCUSSION has already been SOLVED! Thanks again!

  • How to view what was returned in wwsec_api.person_info

    How would someone go about viewing what was returned in wwsec_api.person_info, I understand it returns a record but I'm not sure what the columns are other than a few that I figured out such as first_name, last_name.

    Andrew,
    This information is stored in the Oracle Internet Directory (OID). The PDK-June (available very soon) contains 2 sample portlets accessing user information from the OID, such as first name, last name, or email address.
    Note, that your portal version must be 9.0.2.6, or higher to get these portlets to work.
    The is_runnable functionality on the Java side is implemented in the form of security managers.
    Hope this helps,
    Peter

  • With my computer crashed how to get what's in the ipod

    My computer crashed so I can't copy any file from itunes, how can i get what's in my ipod to a new computer?

    Connect your iPod to your computer. If it is set to update automatically you'll get a message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all the songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it. Also when using most of the utilities listed below your iPod needs to be enabled for disc use, changing to manual update will do this by default. Check the "manually manage music and videos" box in Summary then press the Apply button: Managing content manually on iPod
    Once you are safely connected there are a few things you can do to restore your iTunes from the iPod. If you have any iTunes Music Store purchases the transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. You'll find details in this article: Copying iTunes Store purchases from your iPod to a computer
    The transfer of content from other sources such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. Have a look at the web pages and documentation, this is just a small selection of what's available, they are generally quite straightforward. You can read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    TuneJack Windows Only
    iPod2PC Windows Only
    iGadget Windows Only
    iDump Windows Only
    iRepo Mac and Windows
    iPodRip Mac & Windows
    YamiPod Mac and Windows
    Music Rescue Mac & Windows
    iPodCopy Mac and Windows
    There is also a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows or a Mac. The procedure is a bit involved and won't recover playlists but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod
    Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync. I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay.

  • How to get the Real Path of a file which is accessed  by URL?

    iam using tomcat6.0.
    I have a file xyz.xml at the top of the webapplication HFUSE which i can able to access by URL
    http://localhost:8080/HFUSE/xyz.xml
    My problem is how to get the realpath of the file "xyz.xml" for reading and writing purposes.
    I tried various things but i could not able to successfully solved the problem?
    1) File f = new File("/xyz.xml");
    print(f.getAbsolutePath()) ============== it is not fetching the file @ http://localhost:8080/HFUSE/xyz.xml rather it is creating a file
    at the root of the drive where eclipse is running.
    2) File f = new File("xyz.xml");============> this is also not working , it is creating the file xyz.xml in the eclipse directory ..................
    Can anyone please guide on this problem?

    RevertInIslam wrote:
    If you want your context root(i.e HFUSE)
    use this:
    request.getContextPath() //where request is HttpServletRequest object to get the needful path.
    e.g:
    File f = new File(request.getContextPath()+"/xyz.xml");//it will create the file inside HFUSE.
    Hope this helps.
    Regards
    BWrong. The File constructor expects an absolute filesystem path. The HttpServletRequest#getContextPath() doesn't return the absolute filesystem path, it only returns the relative path from the current context root. Use ServletContext#getRealPath() instead, it returns the absolute filesystem path for the given relative path from the current context root.
    File file = new File(servletContext.getRealPath("/"), "xyz.xml");

  • How to get Adobe Bridge CS5 to open an FLV file in another program?

    Hello Folks,
    How do I get Adobe Bridge CS5 to open an FLV file in another program other than Flash CS5?
    When I double click on an FLV video, it always opens Flash CS5.  I want to be able to use one of my other FLV player apps instead.
    Thanks

    How do I get Adobe Bridge CS5 to open an FLV file in another program other
    than Flash CS5?
    When I double click on an FLV video, it always opens Flash CS5.  I want to be
    able to use one of my other FLV player apps instead.
    For single use when having pointed the cursor on that file with right mouse
    click choose open with and choose the wished application from the fly out
    menu.
    For permanent use go to Bridge Preferences File Type Association section and
    from the list find the .flv file extension. In this line you can select the
    little triangle next to Adobe flash and from the list select the one you
    prefer, now the all open in this chosen app.

  • T61 Characters Displayed Are Not What Was Typed

    Periodically when I type on the keyboard the characters that appear are not the ones I type.  This happens when I try to enter the password to logoin - thank goodness for the fingerprint reader!  It also happens when I am in various applications including MS Word and Outlook.  If I reboot the problem goes away for an undertermined period.  I have run two virus scanning programs and have found no viruses.  Any help would be appreciated.

    To answer the question about what is the 'rubbish'?
    If I try to type 1234567890 I get & é ' " ( Paragraph sign é f c
    The paragraph sign is something I don't know where to find on an ordinary keyboard! the second é is actually e grave and the c has the little squiggle under it.
    If I try qwertyuiop (top line of the keyboard) I get azertyuiop (nearly right)
    If I try zxcvbnm,./ (bottom line) I get w x c v b n , ; :
    Hope that helps I you want any more specific keys please let me know. I am very happy to be told that I am doing something stupid but I have 3 computers and write web sites but it is puzzling me!

  • How to audit what was done in AD?

    if a user modifies an object in AD how do you audit that?  We had some computer accounts deleted and no one will admit to it so I want to know in the future how to prove who did this.
    mqh7

    Hi,
    Here is a more detailed article below for you:
    AD DS Auditing Step-by-Step Guide
    http://technet.microsoft.com/en-us/library/cc731607(v=WS.10).aspx
    Regards,
    Amy

Maybe you are looking for