Code
public static void doSpiral(MouseEvent e,int previousX, int previousY)
      {
        
            int currentX = e.getX();
            int currentY = e.getY();
            /*
            for( int count = 0; count < 50; count ++ ) 
            {
                
                double delta = 50.0;
                double slope = Math.atan2( 3, 1);
                int x2 = (int)(currentX + delta * Math.sin(slope));
                int y2 = (int)(currentY - delta * Math.cos(slope));
                myGraphics.drawLine(currentX,currentY, x2, y2);
                
                currentX = x2;
                currentY = y2;
                
            }
            */
            currentX = e.getX();
            currentY = e.getY();
            
            
          for( int count = 0; count < 50; count++ ) 
          {
          //  drawing continues
          myGraphics.drawLine(previousX, previousY, currentX, currentY);
          /*
           // fat lines
          */
           int x2 = currentX;
           int y2 = currentY;
           double delta = 50.0;
           double slope = Math.atan2(y2 - previousY, x2 - previousX);
           myGraphics.drawLine((int)(x2 - delta * Math.sin(slope)), (int)(y2 + delta * Math.cos(slope)), (int)(x2 + delta * Math.sin(slope)), (int)(y2 - delta * Math.cos(slope)));
           // end fat lines
           
          previousX = currentX;
          previousY = currentY;
          currentX = (int)(x2 + delta * Math.sin(slope));
          currentY =  (int)(y2 - delta * Math.cos(slope));
          }
      }



if (drawingOn && true)
        {
            doSpiral(e,previousX,previousY);
        }
        else 
        {
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.awt.event.*;  
import javax.swing.*;     
/**
 *
 * @author macos
 */
public class camp1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         
    JFrame f=new JFrame("Button Example");  
    
    final JTextField tf=new JTextField();  
    tf.setBounds(50,50, 150,20);  
    f.add(tf); 
    
    JLabel lbl = new JLabel("blank");
    lbl.setVisible(true);
    lbl.setBounds(50, 150, 150, 30);
    f.add(lbl);
    
    JButton b=new JButton("Click Here");  
    b.setBounds(50,100,95,30);  
    b.addActionListener(new ActionListener(){  
public void actionPerformed(ActionEvent e){  
            String textval = tf.getText();  
            lbl.setText(textval);
        }  
    });  
    f.add(b);
    
    f.setSize(400,400);  
    f.setLayout(null);  
    f.setVisible(true);   
        
    }
    
    
}


Lovemygroups.com
CODE
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.awt.event.*;  
import javax.swing.*; 
import java.util.Random;
    
/**
 *
 * @author macos
 */
public class camp1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         
    JFrame f=new JFrame("Button Example");  
    
	JLabel questionlbl = new JLabel("What is your guess?");
    questionlbl.setVisible(true);
    questionlbl.setBounds(50, 30, 150, 30);
    f.add(questionlbl);
	
    final JTextField tf=new JTextField();  
    tf.setBounds(50,50, 150,20);  
    f.add(tf); 
    
	Random myRandom = new Random();
	int pickNumber = myRandom.nextInt(10) + 1;
	
	
	/*
	String string1 = "Hi";
	String string2 = "hi";
	if( string1.equalsIgnoreCase(string2)) {
	}
	*/
	
    JLabel lbl = new JLabel("Waiting for you to guess");
    lbl.setVisible(true);
    lbl.setBounds(50, 150, 150, 30);
    f.add(lbl);
    
    JButton b=new JButton("Click Here");  
    b.setBounds(50,100,95,30);  
    b.addActionListener(new ActionListener(){  
public void actionPerformed(ActionEvent e){  
            
			
			String textval = tf.getText();  
			int intval = Integer.parseInt(textval);)
			if( pickNumber == intval ) {
				lbl.setText("You guessed it!");

	                        pickNumber = myRandom.nextInt(10) + 1;

			}
			else {
				lbl.setText("Try again!");`
			}
            
        }  
    });  
    f.add(b);
    
    f.setSize(400,400);  
    f.setLayout(null);  
    f.setVisible(true);   
        
    }
    
    
}