Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to derive from JButton

Reply
Thread Tools

how to derive from JButton

 
 
Andreas Böhme
Guest
Posts: n/a
 
      11-30-2003
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


 
Reply With Quote
 
 
 
 
Anthony Borla
Guest
Posts: n/a
 
      11-30-2003
"Andreas Böhme" <(E-Mail Removed)> wrote in message
news:bqcene$dfp$07$(E-Mail Removed)-online.com...
> 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/tutor...ing/index.html

for all your GUI code sample needs !

I hope this helps.

Anthony Borla


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-30-2003
"Anthony Borla" <(E-Mail Removed)> wrote in message
news:kGjyb.33592$(E-Mail Removed)...
> "Andreas Böhme" <(E-Mail Removed)> wrote in message
> news:bqcene$dfp$07$(E-Mail Removed)-online.com...

....
> > what's wrong?

....
> 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..

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


 
Reply With Quote
 
Andreas Böhme
Guest
Posts: n/a
 
      11-30-2003
sorry - i forgot to paste in the code...
the link seems usefull - thank you!


"Anthony Borla" <(E-Mail Removed)> schrieb im Newsbeitrag
news:kGjyb.33592$(E-Mail Removed)...
> "Andreas Böhme" <(E-Mail Removed)> wrote in message
> news:bqcene$dfp$07$(E-Mail Removed)-online.com...
> > 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/tutor...ing/index.html
>
> for all your GUI code sample needs !
>
> I hope this helps.
>
> Anthony Borla
>
>



 
Reply With Quote
 
Tim Ward
Guest
Posts: n/a
 
      12-01-2003
"Anthony Borla" <(E-Mail Removed)> wrote in message
news:kGjyb.33592$(E-Mail Removed)...
> "Andreas Böhme" <(E-Mail Removed)> wrote in message
> news:bqcene$dfp$07$(E-Mail Removed)-online.com...
> > 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 ?


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".

--
Tim Ward
Brett Ward Limited - www.brettward.co.uk


 
Reply With Quote
 
Anthony Borla
Guest
Posts: n/a
 
      12-02-2003

"Tim Ward" <(E-Mail Removed)> wrote in message
news:bqfd9s$2115sc$(E-Mail Removed)-berlin.de...
> "Anthony Borla" <(E-Mail Removed)> wrote in message
> news:kGjyb.33592$(E-Mail Removed)...
> > "Andreas Böhme" <(E-Mail Removed)> wrote in message
> > news:bqcene$dfp$07$(E-Mail Removed)-online.com...
> > > 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 ?

>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 1 10-04-2005 12:29 PM
Unit Testing classes that derive from IHttpHandler Brian Takita ASP .Net 5 05-26-2005 11:01 PM
Best Practices- how to derive full Email address from Username JC ASP .Net 0 08-28-2004 03:03 AM
Can't derive from abstract web page Henke ASP .Net 4 08-13-2004 02:34 PM
Not able to derive from abstract class Amil ASP .Net 1 11-20-2003 11:16 AM



Advertisments