when I increase and decrease the size of frame by cursor , all the contents within JFrame should increase and decrease with the JFrame. If I fix the size of other component within frame, it should increase but should not decrease from its fixed size.
Asked
Active
Viewed 89 times
0
-
3*"..I need to fix the size"* We need a question. Do you have a question? – Andrew Thompson Mar 07 '14 at 12:41
-
Two words [Layout Manager](http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html). See [this answer](http://stackoverflow.com/a/21376596/2587435) to see which ones with stretch your components. – Paul Samsotha Mar 07 '14 at 12:44
-
@ Andrew Thompson i dont get you, plz explain... – Laxmeena Mar 07 '14 at 12:45
-
Your statements contradict each other. **1)** _"I need to fix the size of Jpanel, Textbox, button"_ **2)** _"when I increase and decrease the size of frame by cursor , all the contents within JFrame increase and decrease"_ – Paul Samsotha Mar 07 '14 at 12:52
-
@peeskillet That is not i want. It should not decrease from fixed size which is given for other component inside the frame. – Laxmeena Mar 07 '14 at 12:53
-
3You need to ask a question, if there is a problem you are facing. What you have so far is a **story** – Paul Samsotha Mar 07 '14 at 12:56
-
See [here](http://stackoverflow.com/tour) for how to ask a good question. – Paul Samsotha Mar 07 '14 at 13:01
-
I read it as: "all items need to scale with the frame. Except if I fix the size of an item, in which case it can only increase in size, but not decrease beyond the minimum." All of which is doable, and most of which is supported by default with GUI components when added to a frame. – Gorbles Mar 07 '14 at 14:05
1 Answers
0
You need to use some LayoutManager, only then all the components inside it will resize with the parent frame. (Also it will try to keep the ratio, depending on manager you choose) There are good examples on this link, first write simple layouts and then make more complex. If this was your question in the first place of course.

Dejan
- 3,046
- 3
- 28
- 43