jusfau Offline

33 Male from Statesboro       45
easy going

jusfau got the 100 Words badge 10 years ago Report
0
jusfau got the Wordy Won 5 badge 10 years ago Report
0
jusfau got the 7 Letter Word badge 10 years ago Report
0
jusfau got the 6 Letter Word badge 10 years ago Report
0
anjie791
anjie791: SANTA CLAUSE IS COMING TO TOWWWNNNNNNN!!!! Be ready!
11 years ago Report Link
2
View all 6 posts
jusfau
jusfau: lol..love you guys...mucho mucho mucho...
11 years ago Report
2
Sophia__
Sophia__: anjie left
11 years ago Report
0
jusfau 11 years ago Report
0
jusfau got the Social Drinker badge 11 years ago Report
0
View all 4 posts
jusfau 11 years ago Report
0
fsecordb208
fsecordb208: ye y da rling
11 years ago Report
0
fsecordb208
fsecordb208: your so hot lookng and yummy
11 years ago Report
0
jusfau
jusfau to anjie791: lol
11 years ago Report Link
1
anjie791
anjie791: Well said captain!
11 years ago Report
0
jusfau
11 years ago Report Link
1
jusfau
11 years ago Report Link
1
jusfau
11 years ago Report Link
1
slickjava
slickjava: Test this out!


package com.jason.text;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
public class ColourFontTextChanger extends JFrame{

private static final long serialVersionUID = 1L;
private JButton colorbtn = new JButton ("Change text Colour";
private Color colortext = (Color.BLACK);
private JTextField input = new JTextField (10);
private JCheckBox bold = new JCheckBox ("Bold";
private JCheckBox italics = new JCheckBox ("Italics";

public ColourFontTextChanger() {
setTitle("Text Changer";
setSize(44,77);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
add(input);
add(italics);
add(bold);
add(colorbtn);
colorbtn.addActionListener(new ColorHandler());
bold.addItemListener(new BoldItalicHandler());
italics.addItemListener(new BoldItalicHandler());
setVisible(true);
pack();

}

private class ColorHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
colortext = JColorChooser.showDialog(null, "Choose the color", colortext);
if(colortext == null)
colortext = Color.BLACK;
input.setForeground(colortext);
}
}
private class BoldItalicHandler implements ItemListener {
private Font font;
public void itemStateChanged(ItemEvent event) {
if(bold.isSelected() && italics.isSelected())
font = new Font("Serif", Font.BOLD + Font.ITALIC, 16);
else if(bold.isSelected())
font = new Font("Serif", Font.BOLD, 16);
else if(italics.isSelected())
font = new Font("Serif", Font.ITALIC, 16);
else
font = new Font("Serif", Font.PLAIN, 16);
input.setFont(font);
}
}

}
11 years ago Report Link
0