Link to home
Start Free TrialLog in
Avatar of meow00
meow00

asked on

print a number (string) in a Frame ...

Hi Experts,

   How do I print a number (or a string) at a certain location of a frame ? thanks !
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
use a null layout and add a Lael at the required location.
(assuming Swing)

Label l = new Label("Hello");
frame.setLayout(null);
frame.add(l);
label.setBounds(x, y, w, h);
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CI-Ia0s
CI-Ia0s

objects: wouldn't you set the layout of the content pane to null in the swing example?

i.e.:
frame.getContentPane().setLayout(null);
> objects: wouldn't you set the layout of the content pane to null in the swing example?

correct, missed that when showing the swing difference.
Ok, good. I don't feel so confused any more. ;)