Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Help-needed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the following code I just see an empy frame no text. Please explain why?

[ January 14, 2002: Message edited by: Cindy Glass ]
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to look at TextArea's default drawing behavior, and also look at how LayoutManagers work to get a better sense of how to do what you want to do.
Your basic problem is that you aren't setting a layout manager for your panel, so it's using the default which is FlowLayout, then you are adding three TextAreas with a HUGE font size, which makes these areas HUGE by default, and they are placed in a horizontal row from left to right...right of the right side of the Frame so you can't see them. I'd suggest you try using a TextField instead of a TextArea and compare the difference in screen real estate each component takes up.
I made a few minor changes to this code and at least now you can see stuff on the screen. Compare it to your code and see what is different.

Good luck!

Rob

[ January 11, 2002: Message edited by: Rob Ross ]
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob has some good points. But you want to make a minimal changes to get something working, set the size of the text areas, as in
new TextArea(1,15)
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic