Re: adding a graphics2d object to a jpanel



On 2006-01-31, 6e penned:
> What Im trying to do in the end is to create a graphic object that
> can be inserted into a JScrollPane. I would like to implement it in
> such a way so that I can detect the text that is drawn to the
> screen, and when the text is clicked on, I want to give the user an
> opportunity to edit the text.
>
> The text will appear in both the graphic and a table of information.
> So by clicking on the graphic, if I cannot edit the text directly, I
> will select the row on the table that the user needs to edit in
> order for the editting to be done, while highlighting the text in
> the graphic. When the user is done editting the text, I want to
> refresh the graphic... If it cannot be editted in real time.
>
> Does that explain it alright?

Can you explain what effect you want without referring to any java
components? Like, pretend that you're just a user and you're
describing an application you used.

Something like: "It's a dialog box that presents the user with the
name, address, and date of birth that we have on record for them. If
any of that information is out of date, they can click on the
associated field and edit it, then click on an OK button to save the
changes."

The reason I ask is that I get a really strong vibe that you don't
understand how to use Swing components, but if we had a description
of the end effect you want, maybe we could help you get there.

Is there any reason you can't use a JTextField or JTextArea? Why do
you need to draw anything at all? And why wouldn't you be able to
edit the text directly?


--
monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
.