In order to cause the paint(Graphics) method to execute, which of the following is the most appropriate method to call:
1 paint()
2 repaint()
3 paint(Graphics)
4 update(Graphics)
5 None �
you should never cause paint(Graphics) to execute
the ans was 2 , but i guess shouldnt be 1.
//code 2
import java.awt.*;
public class FrameTest extends Frame {
public FrameTest() {
add (new Button("First"));
add (new Button("Second"));
add (new Button("Third"));
pack();
setVisible(true);
}
public static void main(
String args []) {
new FrameTest();
}
}
IN the above code there is no change if i remove pack. what is pack meant for. and also it prints "third" which occupies the frame size why?
plz help thanks in advance
------------------
"Winners don't do different things
They do things differently"