• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

APPLETS - JUST NOT GETTING IT

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started learing about applets. I have been trying to do the examples that are in the book that I have and I am just not getting it and they don't work, the book that I have is Java Programming second edition and I am using JBuilder to do them. I am not sure that I am using JBuilder correctly for them can anyone give me any help. The question that I am doing is.
A) Create a Swing applet that asks a user to enter a password into a JTextField and to then press<Enter>. Compare the password to "Rosebud"; if it matches, display "Access Granted"; if not, display "Access Denied"; Save the program as JPassword.java
B) Modify the password applet in "A" to ignore differences in case between the typed passowrd and "Rosebud".
C) Modify the password applet in exercise "B" to compare the password to a list of five valid passwords; "Rosebud", "Redrum", "Jason", "Surrender", or "Dorothy".
Please explain to me how to use JBuilder to do this or try it and see if it works in there for you.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a *very* basic applet, just add your code for [ENTER]



here's the html code to run it

 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the Applets forum...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While we have a forum dedicated to conversations on IDEs, I think that you'd be doing yourself a favor to figure out the "manual" way of compiling and running an Applet. That's why I moved this to the Applets forum.

Following the above example code, create a Java source file name TestApplet.java and compile it to create TestApplet.class, then create an html page named most-anything-you-like, with the html contents above. You hopefully can just double-click the html file to open it in your browser and interact with the Applet. If you have a J2SE SDK installed and your PATH set correctly, you should also be able to run the Applet using the appletviewer tool. You'd just run the following command.

appletviewer TestPage.html

Now, if you just gotta use that fancy JBuilder program, but you can't figure out how to do so, I'd suggest moseying on over to our IDEs and Other Tools forum, and posting a new thread. Don't forget to let folks know which version of JBuilder you have.
 
You showed up just in time for the waffles! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic