• 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

How to create a node like a basic shape in visio diagram?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I need to develop a java application to create flow model.
The basic frame just like the viso, you can design a flow diagram.My question is How to make the shape editable, in visio, you can type text on the shape, if the text is too lage, it will out of the shape, and when you resize the shape,the text will resize too,out or in the shape.How can I use java to realize it?
if you have some sourcecode like it,it will be great.
thank you.
regards.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest you become very familiar with Swing, especially the graphics portion. Once you've figured out how to create a custom Swing component (extend JComponent, override paint() or paintComponent()), how to make it editable (have a mouse listener or a pop-up menu change the state of the component to an editable one), then it will be a simple task to take the text entered, find out it's size using the font settings and FontMetrics.stringWidth() and adjust the component's size accordingly.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic