Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Displaying AWT widgets in Applets

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a small Applet that has java.awt.List widget. When I look at my applet with an Appletviewer if the one of the List items are longer than the width Java automatically puts a horizontal scroll bar. But the same applet when I look through IE5 or Netscape expands to fit the list item string. Please tell me how I can have a constant size for my List item when running the applet in a browser
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bo!
Here is an example of one solution:

and the html:

<APPLET CODE = "ListTest.class" WIDTH = 640 HEIGHT = 480>
<PARAM NAME=ListWidth VALUE="500">
<PARAM NAME=ListHeight VALUE="100">

Hope this helps.
[This message has been edited by Stephanie Grasson (edited March 16, 2001).]
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, This will work. Thanks for your help. I really wish that the Appletviewer and java plugin would behave in a consistant fasion. It would really help us developers
I found a beautiful pie. And a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic