I want to set the icon of a vertex cell with shape label but nothing seems to work:

\n

Object v1 = graph.insertVertex(parent, null,"Click here", 10, 10, 30, 50,\n "shape=label;image=images/icons/info.png;" );

\n

I also tryed image=file:://imagepath..

\n

Maybe this do not work for java only javascript?\nImageIcon newVertexImage = new ImageIcon("images/icons/info.png"); works.

\n

Or maybe there is a problem for windows?

asked 01 Feb, 13:13

jburger's gravatar image

jburger
112
accept rate: 0%

edited 02 Feb, 09:50


without the drive name it works now with a full path.

\n

Where must the images be placed for a relative path?\nI want to include the images if possible in my jar file...

link

answered 02 Feb, 10:34

jburger's gravatar image

jburger
112
accept rate: 0%

Very confusing, when i set the style image my cpu performance goes to 100%?!

\n

"shape=image;image=file:///documente/studium/Diplomarbeit/worspace/buildtreebank/images/office_building.png;"

\n

Perhaps anything do not function with this style..?? \nMaybe it is because of the absolute but not nessessary unique path under windows?

\n

Can anyone tell me how can i use rellative paths here?\nWere must the images be located.

link

answered 03 Feb, 10:33

jburger's gravatar image

jburger
112
accept rate: 0%

See com.mxgraph.examples.swing.GraphEditor.java for an example (line 116, line 124).

link

answered 03 Feb, 22:23

Gaudenz's gravatar image

Gaudenz ♦♦
7.4k15
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×56
×37

Asked: 01 Feb, 13:13

Seen: 286 times

Last updated: 03 Feb, 22:23

powered by BitNami OSQA