Minggu, 04 Desember 2011

Contoh Program Sederhana Pengeditan Tulisan menggunakan Java Applet

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String s;
s=jTextField1.getText();
jLabel1.setText(s);
}
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
if(jCheckBox1.isSelected()==true && jCheckBox2.isSelected()==true)
jLabel1.setFont(new java.awt.Font(“Tahoma”, 3, 14));
if(jCheckBox1.isSelected()==true && jCheckBox2.isSelected()==false)
jLabel1.setFont(new java.awt.Font(“Tahoma”, 1, 14));
if(jCheckBox1.isSelected()==false && jCheckBox2.isSelected()==true)
jLabel1.setFont(new java.awt.Font(“Tahoma”, 2, 14));
if(jCheckBox1.isSelected()==false && jCheckBox2.isSelected()==false)
jLabel1.setFont(new java.awt.Font(“Tahoma”, 0, 14));
}
private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
private void jRadioButton4ActionPerformed(java.awt.event.ActionEvent evt) {
jLabel1.setForeground(new java.awt.Color(255, 255, 0));
}
private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt)
{
jLabel1.setForeground(new java.awt.Color(0, 0, 255));
}
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
jLabel1.setForeground(new java.awt.Color(0, 255, 0));
}
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
jLabel1.setForeground(new java.awt.Color(255, 0, 0));
}

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by I Gede Putra - Premium Blogger Themes | Bluehost