if (isSelected) tf.selectAll();
return tf;
}
}
}
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Hi John,
A really big thank you for your demo.
I am impressed by the coloring
on the cell chosen and the grid's 4 by 4 appearance.
With a very few modifications this scratch pad
is complete.
Making comment about my earlier questions
and answers that you helped me with, that is,
making sub images out of a larger image.
<http://groups.google.com/group/comp.lang.java.help/browse_thread/
thread/3eb3b7a6599b23ab#>
I have removed the control of the fixed grid.
<http://groups.google.com/group/comp.lang.java.help/browse_thread/
thread/76f86e4cfb54f6c6#>
I now move separate but shuffled sub images to
recombine into the original image.
It is highly graphical specific. Image movement is
not with a mouse but controls using
input from a JTextField(s) and a click on a custom drawing.
Your scratch pad helps me to keep track of
what numbered image to move when getting
to a stage of final alignment. There are 16
sub images.
Thanks again. I truly appreciate it.
bH- Hide quoted text -
- Show quoted text -
Hi All,
Taking a second look at the problem
of a Scratch pad, and at Roedy's suggestion
to write my own ("skinning the cat"),
this program runs and accomplishes the task of
making a "scratch sheet". The "0,1,2,... 15' numbers are
entered in the JTextField and based on where the mouse
click occurs, the grid and click locations and numbers are
maintained throughout the run of the program.
I am frustrated by the list of errors that
are displayed "during the run". I want help to correct them.
Your help is appreciated. First the program
and then the list of errors.
TIA,
bH
import java.awt.Point;
import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionEvent;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class ScratchPadVer2 extends JFrame implements
ActionListener {
private Point clickPoint = null;
private JButton closeBtn = new JButton();
private int t = 20;
private int[] locX = new int[t];
private int[] locY = new int[t];
private String []cellItem = new String[t];
private JPanel infoPanel = new JPanel();
private JLabel topLbl1 = new JLabel ("Enter Picture Number " )=