how to derive from JButton

A

Andreas Böhme

hi all!

i want to create some buttons for a video-application (start, stop, ...).
i tried to derive from jbutton, and override paintComponent(Graphics g), but
it didn't work.
what's wrong? has anyone any sample-code?

thanks for your help

burny
 
A

Anthony Borla

Andreas Böhme said:
hi all!

i want to create some buttons for a video-application
(start, stop, ...). i tried to derive from jbutton, and
override paintComponent(Graphics g), but it didn't work.
what's wrong?

May I ask *how* you expect anyone here to diagnose your problems without you
posting any code ?
has anyone any sample-code?

Check out:

http://java.sun.com/docs/books/tutorial/uiswing/index.html

for all your GUI code sample needs :) !

I hope this helps.

Anthony Borla
 
A

Andrew Thompson

Anthony Borla said:
....
May I ask *how* you expect anyone here to diagnose your problems without you
posting any code ?

I 'spose the OP is expecting us to use the group's
crystal ball.

Problem is, we loaned it to the folks over at
c.l.j.gui and they won't give it back.. ;-)
 
A

Andreas Böhme

sorry - i forgot to paste in the code...
the link seems usefull - thank you!
 
T

Tim Ward

Anthony Borla said:
May I ask *how* you expect anyone here to diagnose your problems without you
posting any code ?

Come on, that was a perfectly reasonable initial question, inviting an
answer that would split the problem space at least in half: either "no, you
can't do it that way, because of yyy, you need to look at xxx instead" or
"yes, you can do it that way, you must have a bug in your code" or even
"yes, you can do it that way, but you should be aware of the following
bog-standard gotcha".
 
A

Anthony Borla

Tim Ward said:
Come on, that was a perfectly reasonable initial question,
inviting an answer that would split the problem space at least
in half: either "no, you can't do it that way, because of yyy,
you need to look at xxx instead" or "yes, you can do it that
way, you must have a bug in your code" or even "yes, you
can do it that way, but you should be aware of the following
bog-standard gotcha".

Unfortunately the OP didn't mention quite basic things as whether it was
compilation or runtime problems that were experienced, or, assuming
successful compilation, elaborate on what 'didn't work' - e.g. the button
wasn't visible, or the wrong colour, or didn't respond to events, and so on.
The failure to provide more specific details, or post the relevant 'problem'
code, makes it impossible to diagnose the problem, and honestly answer [as
opposed to guess at] the question:

'What's wrong ?'

In hindsight I do admit that I could have been less abrupt and sought
additional details. In fact, when answering queries containing fairly
sketchy details, I often do do this, or make a 'best guess' attempt, and
reply with some sample code snippets. I believe, however, being asked to
answer such a fundamental question [i.e. 'What's wrong ?'] without being
given enough of the facts [IMO] with which to do so caused momentary
annoyance, hence the curtness of my reply.

My client relationship skills are [usually] excellent :) !

Cheers,

Anthony Borla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top