Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Swing / AWT / SWT
graph
shalini gnana
Ranch Hand
Posts: 189
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
can anyone say me how to draw a graph by getting x,y co-ordinates(not by calculating the co-ordinates) in
applet
with scrollpane.
Campbell Ritchie
Marshal
Posts: 79180
377
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You will have to get yourself a Component you can actually draw on. You can't draw on a JScrollPane, but you can put something like a JPanel on it. You can draw on a JPanel with the usual methods, paintComponent() and Graphics.drawPolyLine().
Rob Spoor
Sheriff
Posts: 22783
131
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Override getPreferredSize() to return the size you want so it will scroll, because otherwise it will never scroll without any components on it.
Basically returning the most bottom-right point of the drawing would be good.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Campbell Ritchie
Marshal
Posts: 79180
377
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please don't ask the same question twice.
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
tooltip
label in coordinates
graph
tooltip
label
More...