Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is the component to change frame size?

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JSplitPane allows you to do that.
 
Anton Sotnikov
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 79019
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I think you have misspelt something


In my English or in java code?
 
Campbell Ritchie
Marshal
Posts: 79019
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic