• 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

Custom Swing Text Component?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Maybe someone can help me with this problem. I need a text component in Java that resizes itself dynamically. For example, it starts off at initial size (1 char wide and high), surrounded by a black rectangle. As I type, this rectangle will grow horizontally, and can grow vertically up until 5 lines.
Also, this component will be wrapped inside of another class that handles clicking on the object and moving it around a drawing area (a JComponent), in this case. So it's positioning is dynamic as well, based on where the user drags and drops the component.
This is probably confusing and vague, but if you have any insight into a good way to do this, or something in Java to help, please email me.
At this point I've tried extending JTextComponent, but get a null pointer exception that I've had little to no luck tracing.
Cheers!
Tom
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic