站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Tutorial 5.0 英文版

Questions and Exercises: Getting Started with Swing - Java Tutorial 5.0 英文版

The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail Search
Feedback Form

Trail: Creating a GUI with JFC/Swing
Lesson: Getting Started with Swing

Questions and Exercises: Getting Started with Swing

Questions

Question 1: Which package is required for all Swing applications?
Answer 1:javax.swing

Question 2: What is Java Web Start and where can you get it?
Answer 2: Java Web Start is a technology that simplifies the distribution of applications. With a click on a Web page link, you can launch full-featured applications without a complicated download and installation process. In v1.4.1 and later releases of the Java platform, Java Web Start is shipped as part of the platform.

Exercises

Question 1: Show how you would set the class path when launching an application.
Answer 1: For programs that use a nonstandard look and feel or any other nonstandard code package, you must make sure that the necessary classes are in the class path. For example:
Solaris/Linux
java -classpath.:/home/me/lnfdir/newlnf.jar HelloWorldSwing

Microsoft Windows
java -classpath .;C:\java\lnfdir\newlnf.jar HelloWorldSwing

Question 2: Test if your browser is Java Web Start enabled by following the instructions listed in this lesson.
Answer 2: If you encountered any problems, be sure to refer to the Java Web Start FAQ.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail Search
Feedback Form