fontSelect


To use it add next statements to your code

fntSel = new fontSelect(frame, true);
fntSel.show();

Class fntSel has four public variable, after closing dialog you can use them:

boolean isSelected - True if selection was made; selectedFont, selectedBackground, selectedForeground are

set to value what you selected, otherwise they are null.

Font selectedFont - the font what you selected if isSelected is true.

Color selectedBackground - the background color what you selected if isSelected is true.

Color selectedForekground - the foreground color what you selected if isSelected is true.

fntSel = new fontSelect(fr, true);
fntSel.show();


if (fntSel.isSelected) {


label1.setFont(fntSel.selectedFont);
label1.setBackground(fntSel.selectedBackground);
label1.setForeground(fntSel.selectedForeground);
label1.setText("Font has been selected");


}
This class was written using Java 1.1 process event model.

 


Back to fontSelect applet page

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.