0

I need to change the font size after I click. How can I do that - Thanks!

here is the code

import java.applet.*;
import java.awt.*;
import java .awt.event.*;
import javax.swing.*;
import java.util.*;
public class JChangeFont extends JApplet implements ActionListener
  {
   
    JLabel question = new JLabel("Who's number one?");
   JButton click = new JButton("Click");
   JLabel questionText = new JLabel(" ");
   Container con = getContentPane();
	 
	 public void init()
	 	   {

	     con.add(question);
	    con.add(click);
	    con.setLayout(new FlowLayout());
	    click.addActionListener(this);
	   }
		  
   public void actionPerformed(ActionEvent e)
 	   {
	
			 	questionText.setText("Who's number one?");
				con.add(questionText);
				validate();
		}
 }

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by peter_budo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.