How can i clear the textfield and the list selections?

How can i clear the textfield and the list selections?
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
<applet code="ListDemo" width=300 height=400>
</applet>
public class ListDemo extends Applet implements ActionListener {
List os, browser;
String msg = "";
String text;
String named = "";
TextField name;
Button Ok, reset;
public void init() {
Ok = new Button("Ok");
reset = new Button("reset");
add(reset);
add(Ok);
reset.addActionListener(this);
Ok.addActionListener(this);
Label namep = new Label("Name: ", Label.RIGHT);
name = new TextField(12);
add(namep);
add(name);
name.addActionListener(this);
os = new List(4, false);
browser = new List(4, false);
os.add("default");
os.add("BMW");
os.add("BENZ");
os.add("Lexus");
os.add("Acura");
browser.add("default");
browser.add("Red");
browser.add("Black");
browser.add("Silver");
browser.add("Blue");
browser.add("Yellow");
browser.add("Pink");
browser.add("Grey");
browser.add("Blue/Black");
os.select(0);
browser.select(0);
add(os);
add(browser);
os.addActionListener(this);
browser.addActionListener(this);
public void actionPerformed(ActionEvent ae) {
String str = ae.getActionCommand();
if(str.equals("Ok")){
text = "You pressed Ok";
else
if(str.equals("reset")){
browser.select(0);
os.select(0);
text = "";
repaint();
public void paint(Graphics g) {
g.drawString("Name: " + name.getText(), 6, 120);
int idx[];
msg = "Current Car: ";
idx = os.getSelectedIndexes();
for(int i=0; i<idx.length; i++)
msg += os.getItem(idx) + " ";
g.drawString(msg, 6, 140);
msg = "Current Color: ";
msg += browser.getSelectedItem();
g.drawString(msg, 6, 160);
g.drawString(text, 6, 200);

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
<applet code="ListDemo" width=300 height=400>
</applet>
public class ListDemo extends Applet implements ActionListener {
List os, browser;
String msg = "";
String text;
String named = "";
TextField name;
Button Ok, reset;
public void init() {
Ok = new Button("Ok");
reset = new Button("reset");
add(reset);
add(Ok);
reset.addActionListener(this);
Ok.addActionListener(this);
Label namep = new Label("Name: ", Label.RIGHT);
name = new TextField(12);
add(namep);
add(name);
name.addActionListener(this);
os = new List(4, false);
browser = new List(4, false);
os.add("default");
os.add("BMW");
os.add("BENZ");
os.add("Lexus");
os.add("Acura");
browser.add("default");
browser.add("Red");
browser.add("Black");
browser.add("Silver");
browser.add("Blue");
browser.add("Yellow");
browser.add("Pink");
browser.add("Grey");
browser.add("Blue/Black");
os.select(0);
browser.select(0);
add(os);
add(browser);
os.addActionListener(this);
browser.addActionListener(this);
public void actionPerformed(ActionEvent ae) {
String str = ae.getActionCommand();
if(str.equals("Ok")){
text = "You pressed Ok";
else
if(str.equals("reset")){
browser.select(0);
os.select(0);
text = "";
name.setText("");
repaint();
public void paint(Graphics g) {
g.drawString("Name: " + name.getText(), 6, 120);
int idx[];
msg = "Current Car: ";
idx = os.getSelectedIndexes();
for(int i=0; i<idx.length; i++)
msg += os.getItem(idx) + " ";
g.drawString(msg, 6, 140);
msg = "Current Color: ";
msg += browser.getSelectedItem();
g.drawString(msg, 6, 160);
g.drawString(text, 6, 200);

Similar Messages

  • Hi, I am trying to download IOS7 to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hi, I am trying to download IOS7 (not sure if it's 1 or 2) to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hello Den53,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430?viewlocale=en_US
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    After the device has turned off, press and hold the Sleep/Wake button until the Apple logo appears.
    Best of luck,
    Mario

  • How can I save my data and the date,the time into the same file when I run this VI at different times?

    I use a translation stage for the experiment.For each user in the lab the stage position (to start an experiment) is different.I defined one end of the stage as zero. I want to save the position , date and time of the stage with respect to zero.I want all these in one file, nd everytime I run it it should save to the same file, like this:
    2/12/03 16:04 13567
    2/13/03 10:15 35678
    So I will track the position from day to day.If naybody helps, I appreciate it.Thanks.

    evolution wrote in message news:<[email protected]>...
    > How can I save my data and the date,the time into the same file when
    > I run this VI at different times?
    >
    > I use a translation stage for the experiment.For each user in the lab
    > the stage position (to start an experiment) is different.I defined one
    > end of the stage as zero. I want to save the position , date and time
    > of the stage with respect to zero.I want all these in one file, nd
    > everytime I run it it should save to the same file, like this:
    > 2/12/03 16:04 13567
    > 2/13/03 10:15 35678
    >
    > So I will track the position from day to day.If naybody helps, I
    > appreciate it.Thanks.
    Hi,
    I know the function "write to spreadsheet file.vi"
    can append the data
    to file. You can use the "concatenate strings" to display the date,
    time as well as data... Hope this help.
    Regards,
    celery

  • I ordered Illustrator for another user.  I received an invitation that was accepted, logged in and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person?

    I ordered Illustrator via creative cloud for another user.  I received an invitation that was accepted  and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person? 

    Cloud as a Gift https://forums.adobe.com/thread/1665610

  • I have just updated my phone in icloud and I have lost all my data including my large music collection from itunes. How can I recover my music and phone list?

    I have just updated my phone in icloud and I have lost all my data including my large music collection from itunes. How can I recover my music and phone list?

    Welcome to the Apple Community.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option which is revealed in the iTunes app on your iOS device by tapping the more button at the bottom of the screen.

  • How can I restore my bookmarks, and the Firefox drop-down in the top left?

    I cannot use Firefox as I always used to.
    It has lost all of my Bookmarks Bar, so I cannot go to, for example, my email link.
    It goes straight to a full screen display of my (Google) homepage and won't let me see the old Firefox drop-down in the top left corner.
    How can I get any Firefox help?
    I can just about survive using Internet Explorer - is that what Mozilla want?
    oh, it's back now. what happened?

    Hello,
    you can easily move the Bookmark icon to left using the Customize feature from the Menu [[Image:New Fx menu]] button on the Right top corner.
    please also see:
    *Classic Theme Restorer. https://addons.mozilla.org/hu/firefox/addon/classicthemerestorer/
    *https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox
    *https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox

  • There is a strange yahoo search in the tabs section. after downloading firefox 8.0.1. how can this be removed? and the defult start up page is yahoo instead of firefox

    how can the yahoo extras be removed. is there a way to go back to the older firefox version?

    ''Yahoo Toolbar messes up Location Bar Search''
    '''Remove the Yahoo Toolbar'''
    # "Ctrl+Shift+A" (Add-ons Manager)
    # Select Puzzle piece on left-side for Extensions List
    # Find "Yahoo Toolbar" and click on "Uninstall" button, and restart Firefox. ''(if you really need to keep the Yahoo toolbar, you can hide the toolbar instead with customize, and still change all the search defaults as below)''
    '''Then to fix the default search engine''' used at the Location Bar, change the value of '''keyword.URL''' in '''about:config''' to one of the values shown in [http://kb.mozillazine.org/Location_Bar_search#Location_Bar_search_.28external_-_search_engine.29 Location Bar search] at MozillaZine.
    * Google Search (Google search results page)<br>'''http://www.google.com/search?ie=UTF-8&oe=UTF-8&q='''
    # type in '''about:config''' into the location bar (in a new tab)
    # if the warning message nonsense comes up ''uncheck'' the box '''before''' dismissing the dialog message
    # '''filter on keyword'''
    # right-click on '''keyword.URL''' and choose "modify" then paste in the Google search engine string of your choice.
    # '''filter on defaulturl'''
    # right-click on '''browser.search.defaulturl''' ''(if it exists)''and again choose "modify" then paste in the Google search engine string of your choice.
    # '''filter on ytff'''
    # right-click on '''yahoo.ytff.search.popup_src''' ''(if it exists)'' and again choose "modify" then paste in the Google search engine string of your choice, if adventurous might see if "reset" would remove and see if gone in next session (well not for those keeping the extension).
    --used in https://support.mozilla.com/questions/850287
    '''Avoiding the problems:''' Many software installations contain additional baggage known as crapware. The Yahoo Toolbar is packaged with Java [http://imageshack.us/photo/my-images/266/javainstall.png/ picture]
    More information on ask.com, Yahoo Toolbars which involve extensions, not just changes to the home page.
    * http://kb.mozillazine.org/Problematic_extensions
    * Uninstalling toolbars - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Uninstalling_toolbars
    '''More information on configuration variables''' available in
    [http://kb.mozillazine.org/About:config_entries about:config entries] and for users not familiar with the process there is [http://kb.mozillazine.org/About:config about:config] (How to change).

  • How can i connect home sharing and the control app with 2 IP addresses?

    i am using my macbook pro at school and i also take it back home, and when i'm home the home sharing with my iPhone 5's Remote app works perfectly fine, just that when i'm back to res at school it doesn't work for some unknown reason. i've checked everything including the firewall and stuff and itunes home sharing is turned on, i even tried using another home sharing apple id but it still doesn't work. somebody please help!!!
    thanks!

    If you use eithernet for your main connection then just plug the TC bridged into the network.
    If you use wireless for your internet connection then you can use the TC isolated from the network by ethernet.. but this is really only convenient on a desktop Mac.
    The instructions I put in this thread with screenshots.. see near the bottom.
    https://discussions.apple.com/thread/4817218?tstart=30
    It is a bit tricky so if you have questions ask back here.
    Just to say a USB for firewire external drive is faster and more reliable than a TC.. cheaper to buy as well.. although since you already have the TC that is not a concern.. but you can ebay the TC and buy a bigger and better external drive with the proceeds.

  • How can I avoid this message and the crash that follows? -"the program has unexpectedly stopped working and will close"

    I am working on some books that I have had no problem creating in Indesign  and this week, I was doing something and got an error message and had the program crash while I was working on something and lose my unsaved work. It happens all of a sudden and has been frustrating. Thought it was an installation issue, but this also happens on the newest version of CS6.
    The original files (“books”) were created in CS4.
    What I’m doing is copying a template for the appendix that was established in the first book into all subsequent books.
    Here is the process that I used on CS4 for the first 10 books –
    1.       open a file that already has the completed new appendix.
    2.       Open a file that needs the new appendix
    3.       Select the appendix pages from the pages menu in the completed file and “move” them to the new file.
    4.       Voila!
    When I started using CS5 this worked for one book. Now the last book is giving me an error message during step 3. So, I select the pages I want to move and click “move” and then I get a message that says “the program has unexpectedly stopped working and will close”. This is the same message I got with CS6.

    Same problem here. Firefox keeps freezing, sometimes for 5 minutes, then either starts working again really slowly or I get the plug-in error crash. This last time I copied what windows said about the error. This is the info:
    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: plugin-container.exe
    Application Version: 1.9.2.3814
    Application Timestamp: 4c12b3be
    Fault Module Name: ntdll.dll
    Fault Module Version: 6.0.6002.18005
    Fault Module Timestamp: 49e03821
    Exception Code: c0000005
    Exception Offset: 00048b02
    OS Version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033
    Additional Information 1: ca4b
    Additional Information 2: 0db6cc4f646c2246ddf8a462e3add7af
    Additional Information 3: 5b21
    Additional Information 4: e5b7e758762c24b02e09abea0b4585f4
    Don't know what it means or if it will help solve the issue, but thought I would share it.
    All I know is that I am about to do something I never thought I would, switch to Chrome.

  • How can I set my mac (and the screen) to not go on sleep mode ?

    I just want my mac (and the screen) stay alive for a minimum of 8 to 10 hours, not going in sleep mode (or save screen).  Just displaying a web page without doing anything else. In preference system, energy save is all set to «never», but after a while the screen goes to sleep ... ?

    You probably have a corrupt .plist file. To fix:
    1. Hold down the option key.
    2. In the Go menu in the Finder, scroll down to Library
    3. In Library, find Preferences
    4. In Preferences, find com.apple.systempreferences.plist  and drag it to the trash
    5. restart
    6. you will have to reenter your preferences. 
    Another option is caffeine: Lighthead - Caffeine

  • How can I remove telephone lines and the like, on PS CC?

    Hi,
    I have done this already but for the life of me I just cant remember how I did it (it was just so easy!!!) and i cant find it in answers either.
    Please how do you do it?
    Thanks
    Serge

    Yes those can be used but with CC there is a neater way by simply clicking at the two extremities and pouf it goes away...
    But I dont remember how to do it
    Thanks
    Serge

  • How can I swap my photos and the apps I have paid for, from my iphone 4s to iphone 5?

    I am having trouble swapping my photos and videos along with my paid apps to my new phone
    I dont have access to a computer and cant let my old phone go until I have all the pictures.
    Also have a few apps i have paid for.
    Please can someone advise me on this.
    Thank you

    Have you set up the new phone yet?
    If you did you missed it.
    On the iPhone 5:
    Settings > General > Reset > Erase All Contents & Settings
    When it finishes choose the restore from iCloud backup option

  • How can I remove Navigation Panel and "The section which says Please fill the data"

    Hi all,
    I need to remove navigation panel on the left side and also
    the section which is below toolbar and above actual pdf starts which says " you can fill out the following form and save the data.
    Regards
    Vas

    Not Possible

  • How do you clear updated apps from the App Store

    How can you clear updated apps from the list in App Store?

    What do you mean by "clear"?
    Have a look here: iOS 8: App Store Updates Do Not Clear
    If it is the badge count that does not fit, it might be that iTunes is the cause (12.0.1.26).

  • How can i clear the usernames and passwords history from all login websites?

    how can i clear the usernames and passwords in the log in history of the websites? example when i want to login to my facebook i always type first letter of my e-mail and it comes with the passwords because before i put remember my password, and in other websites so, i just need to delete all this login history and it's not working from the clear everything !!! :S any idea please !! thanks in advance :)

    See:
    http://kb.mozillazine.org/Deleting_autocomplete_entries
    http://kb.mozillazine.org/Password_Manager

Maybe you are looking for

  • HOW TO DEFINE VIRTUAL HOST NAME IN HPIA64 + SAP R/3 ENTERPRISES 4.7

    Hi all, I am trying to install sap r/3 enterprises 4.7 with OS as HP-UX and Database as Oracle in a cluster environment. In cluster environment sap installation should be done on virtual hostname ( package id ). I'm using the env variable SAPINST_USE

  • How to change a posting date of an invoice in background

    Hello, I want to change the posting and invoice dates ( to correct many invoices,) I use the MIR4 transaction, the batchinput works fine in foreground, but in background I have the error Control framework : erreur fatale, destination SAPGUI due to en

  • Recording audio from iPad to Mac

    I have an iPad app that allows you to download different audio presentations.  However, the audio is trapped in the iPad app, which means I can't listen to it anywhere but the iPad.  I'd like to transfer this audio to an MP3 so I can listen to it on

  • Viewing 3D pdf files on Android Devices

    Has anyone been able to view 3d pdf's on an android device?

  • Can't log in using aol

    ichat has stopped working for me. I can't log in using my aol screen name. It used to work. Nothing changed. I even created a new aol screen name just to check. It won't work. I deleted the account in prefs, turned off automatic in keychain. Nothing