• 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

swing layout weirdness

 
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can someone please explain to me why this slider is firmly planted in the center of the frame, no matter resizing? I realize the program itself is not working properly at the moment. but for the sake of the layout itself, no matter what i change, dimensions, preferred size, setBounds, the slider is always in the center. any help would be appreciated.



i just want the slider to be under the "your height" label. thanks.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I can see your layout is a vertical Box with three components. The slider is the middle component, so where else could it be but in the middle of the screen? Oh, wait a minute, I just looked at the code for the fourth time and noticed that you added the slider to the GUI in two different places. The first place is the place where you say you wanted it and the second place is the one you don't like.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:As far as I can see your layout is a vertical Box with three components. The slider is the middle component, so where else could it be but in the middle of the screen? Oh, wait a minute, I just looked at the code for the fourth time and noticed that you added the slider to the GUI in two different places. The first place is the place where you say you wanted it and the second place is the one you don't like.



thanks for the response. where did i add it a second time? i'm combing over this and only see me declaring it once, then giving it a value later...
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
67 and 91.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:67 and 91.

i feel stupid now. thanks for pointing that out
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It happens to all of us. The traditional phrase to acknowledge that sort of thing these days is "D'oh!".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic