This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the component to change frame size?

 
Anton Sotnikov
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!
Can you explain what is a swing component have ability to change a size? or just component?
As on image:
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSplitPane allows you to do that.
 
Anton Sotnikov
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

A JSplitPane allows you to do that.

Yes thank you i got it.
But I have a several question about.

This is swing app scheme:



1. When I run my app JFrame - MainFrame - is'not open as full size screen, only when i push a square button in the right top angle, how i can do it automatically during runtime process?

2. How i can controll size of LeftPane when the app is opening. I add JTree and see only little part:


3. I want that the HORIZONTAL_STLIT which divide LeftPane and RightPane have ability to hold on the HORIZONTAL_STLIT which divide UpForm and DownForm. How to do it?





4. Is it a correct code? I want to reduce distance between to JButtons in GridBagLayout.


is it a right way for play with insets parametes?
gc.insets = new Insets(0,10,0,0);
gc.insets = new Insets(0,-950,0,0);


Thank you!
 
m Korbel
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- I'd be use BorderLayout for JPanel added to JFrames CENTER area, or to use fill for GBC correctly

- in all cases to override getPreferredSize insted of setPrederredSize

- override getPreferredSize for JScrollPane with JTree too,

- wrap possition for JSplitPane divider into invokeLater

- use JFrame.pack insted of setSize(800, 800); otherwise any PreferredSize will be schinked to Contents Panes Dimension (is smaler than JFrame.setSize(800, 800);)

- create local variable for JFrame too
 
Anton Sotnikov
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

- I'd be use BorderLayout for JPanel added to JFrames CENTER area, or to use fill for GBC correctly

- in all cases to override getPreferredSize insted of setPrederredSize

like that???



- override getPreferredSize for JScrollPane with JTree too,

for this principle???


- wrap possition for JSplitPane divider into invokeLater

excuse me maybe i didn't understand but i don't find this metod in this link http://docs.oracle.com/javase/8/docs/api/javax/swing/JSplitPane.html


- use JFrame.pack insted of setSize(800, 800); otherwise any PreferredSize will be schinked to Contents Panes Dimension (is smaler than JFrame.setSize(800, 800);)


What does it mean schinked?
 
Campbell Ritchie
Sheriff
Posts: 51413
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have misspelt something. Please tell us exactly where you got that quote from and we shall see if we can explain it to you.
 
Anton Sotnikov
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think you have misspelt something

In my English or in java code?
 
Campbell Ritchie
Sheriff
Posts: 51413
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the second quote:
- use JFrame.pack insted of setSize(800, 800); otherwise any PreferredSize will be schinked to Contents Panes Dimension (is smaler than JFrame.setSize(800, 800);)
 
Anton Sotnikov
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is it what i did:
1. Maximize JFrame -


2.
Proportions of Leftpane


3.
i deleted RightPane and add yet one JSplitePane with UpForm and DownForm:



4. MigLayout - is not bad and is more usefull than GridBagLayout.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic