6
What is the difference in Java Swing between methods setSize and setBounds?
6
What is the difference in Java Swing between methods setSize and setBounds?
5
These two codes are practically equivalent:
int x = ..., y = ..., w = ..., h = ...;
JComponent x = ...;
x.setBounds(x, y, w, h);
int x = ..., y = ..., w = ..., h = ...;
JComponent x = ...;
x.setSize(w, h);
x.setLocation(x, y);
That is, the setBounds is a way to define position and size at the same time, while the setSize sets only the size and the setLocation only the position.
Browser other questions tagged java swing
You are not signed in. Login or sign up in order to post.