Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

refresh canvas, designer problem?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i begin with swing and to get more experience, i begined a small project.
i would like to create a basic entity-relation program who will generate sql script...

on a canvas i draw some shape (entity, link)

when i click on it a panel open.... to change its property... when it's close i would like to refresh canvas...

entity class


class who draw entity on the canvas



in the canvas class, when i click on a entityDrawable, i displaye the EntityPanel





any idea, design suggestion?
thanks
 
Marshal
Posts: 69748
277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your paintComponent() method?
 
robert trudel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Where is your paintComponent() method?



where i supposed to have this method?

i only have a paint method for EntityDrawable
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AWT uses "paint", but Swing uses "paintComponent": http://java.sun.com/docs/books/tutorial/uiswing/painting/closer.html
 
robert trudel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code of my canvas (where i draw the shape)



i have no problem to draw entitydrawable on the jcanvas... i can move it, draw...
the only problem is when i change property of the entity (name, code...) in the EntityPanel, the change done is not applied....

so i need to change paint by paintcomponent in :JCanvas,

in EntityDrawable, i use paint...
    Bookmark Topic Watch Topic
  • New Topic