W
Wong Chee Wee
Dear all,
Recently i wrote some code involving the Graphics2D class in an application.
I used the following code:
public class Result extends JPanel{
public void paintComponent(Graphics comp){
super.paintComponent(comp);
Graphics2D comp2D = (Graphics2D) comp;
In another class, I called a new object of the Result class:
Result aObject = new Result();
This aObject is put into a panel. But on it just won't display correctly
(it'll have a very small area to display the graphics, e.g. 319 by 10
pixels)!
If i use a layout manager with the panel, no graphics is shown.
What is wrong? I would appreciate any help greatly. Thanks.
Regards,
Chee Wee
Recently i wrote some code involving the Graphics2D class in an application.
I used the following code:
public class Result extends JPanel{
public void paintComponent(Graphics comp){
super.paintComponent(comp);
Graphics2D comp2D = (Graphics2D) comp;
In another class, I called a new object of the Result class:
Result aObject = new Result();
This aObject is put into a panel. But on it just won't display correctly
(it'll have a very small area to display the graphics, e.g. 319 by 10
pixels)!
If i use a layout manager with the panel, no graphics is shown.
What is wrong? I would appreciate any help greatly. Thanks.
Regards,
Chee Wee