• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to draw rectangle like corelDraw?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to draw a rectangle and also select it also like coreldraw?


any help me.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

select it also like coreldraw?


Can you elaborate what this means? Not everybody knows CorelDraw.

In general, rectangles are drawn using the Graphics.drawRect and fillRect methods, but you probably already knew that.
 
shahidrasul shahid
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I WANT TO TO DRAW A RECTANGLE

I WANT TO SELECT RECTANGLE.
MOVE RECTANGLE TO OTHER SPACE.
RESIZE RECTANGLE (SMALL,LARGE SIZE).
DELETE RECTANGLE (REMOVE RECTANGLE).

ETC.
 
Sheriff
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please KeepItDown
 
shahidrasul shahid
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am sorry to write in this style....

please help me about my problem

i want to draw a rectangle

then i select rectangle
move rectangle to other space.
resize rectangle (small , large size)
delete rectangle (remove rectangle)

etc.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you have gotten the drawing of the rectangle working now. Here are some things to consider when implementing the other points:

You need to think of what constitutes "selecting the rectangle" - which events do you need handle, and under which conditions should you consider a rectangle to be "selected"?

You also need to indicate which rectangle is selected - usually that's done by drawing little boxes around the corners and in the middle of the sides.

If you have several rectangles, a click may be targeted at any of them - think about how to choose which of the rectangles should be selected.

If a rectangle is selected, what does the user need to do to delete it? What event(s) do you need to handle for this?

Same for resizing - that generally occurs if a user clicks and drags one of the little boxes around the corners or at the middle of the sides. The corner boxes might allow the user to resize two sides at the same time, while the boxes at the side only allow a single side to be moved.
[ May 27, 2008: Message edited by: Ulf Dittmer ]
 
shahidrasul shahid
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you say right

but your link does not give me any information please tell me
whether i implement all these funtionality in rectangle


i am waiting thanks .
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean by "link" - my post doesn't contain any.

And yes, you need to implement all the items I mentioned. Do you have thoughts on any of them yet?
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic