Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Components size  RSS feed

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:

I have a simple test GUI that has 2 panels (a top and a bottom),
the top panel has three components which are two Jcomboxs and one JSlider. I use GridBagLayout for the top panel. The JSlider has a fixed size by using the Dimension() function.

The bottom is an application plotting. I would think that when the GUI is launched, the full image fills the whole bottom panel height with a default zoom level of 1.0.
So my question is:
Can I define the top panel's height, then get the bottom panel's height?

therefore the bottom panel's height is

Thanks
 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am asking the question is because I found a partial bottom of the application is cut off even the maximum value of vertial coordinate is equal to the height of the bottom plane.
why?
 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an executable SSCEE code.

From the printout result, we see the bottom Jplane size is 745 by 745.
But the path has a vertex at (250,745), which can not be displayed.
Eventhough I replaced it with (250,740) whose vertial coordinate is less than the height of the bottom Jplane.
 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get it, post closed.
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!