944,068 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1942
  • Java RSS
Feb 3rd, 2005
0

Axis Labels

Expand Post »
Hey guys n girls, I have two arrays (one for x and one for y axis) which contain labels i would like to display on a graph. How do you recommend i do this?

I was thinking multiple JLabels, spread out depending on the quantity. But If theres a better of way without creating multiple Jabels then that would be better. Maybe hashtable similar to the slider label creation process?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Feb 4th, 2005
0

Re: Axis Labels

I wonder if this would work: Create one array with all the values you need, then create a gridlayout with the certain number of rows and columns you need and then append them to the container set to the grid layout
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Feb 4th, 2005
0

Re: Axis Labels

Hi everyone,

Read the labels into an array and then use the graphics object to paint it on the specified object. Do not forget to valite and repaint the component on which you painted the labels.

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Feb 5th, 2005
0

Re: Axis Labels

Ive actually just created a border layout with the graph in the center, Y axis (panel with gridLayout) to west and x axis (same as Y) south. Then created 5 labels for each y/x panel which i have placed a range of values from some arrays. Its taken some tweaking but it kinda works.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: String Object Immutable Confusion
Next Thread in Java Forum Timeline: Java Help!!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC