Sign in to follow this  
ju2wheels

Java: applications and applets

Recommended Posts

Hi im still in the process of learning Java and had a question about a design thought I had for modifying a future application. Is it possible to add Swing components such as a scrolling pane from an application to an applet(if it were implemented correctly of course)? Im inclined to believe that I can, but since I havent finished reading my book I thought Id ask now so I knew before hand.

Share this post


Link to post
Share on other sites
if i understand correctly, then yes. as long as you import java.awt and/or java.awt.swing. and everything else you would do normally such as
text=new jTextField();, etc... You would do it the exact same way in an applet and a normal application.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Absolutely, yes. Applets are top-level containers, just like JFrames, so all the standard GUI code will work with them. Take a look at the following sections of the Java Tutorial:

http://java.sun.com/docs/books/tutorial/applet/practical/gui.html
http://java.sun.com/docs/books/tutorial/uiswing/index.html

--cfmdobbie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this