-
A Java Swing Question
Hi Pro Developer,
I have a professional question about JFC pluggable look
and feel. I need help on understanding how to create my own
custom UI component, I've looked at the APIs but I'm not
too good at writing code by looking at the APIs what I need
from you is simple sample of a least how to create a custom
button UI in which you can put a .gif button in place of
the standard "gray" color java button. and then I need to
know how you call that class that you already wrote from
another program and use that class and asign it to
different button graphic.. like that .gif or .jpg files.
I will be very happy if you help me on this professional
question my project is a GUI messanger using graphics
instead of the standard java colors.
Thanks in advance,
and I hope to here from you soon.
-
Re: A Java Swing Question
I don't think it's really necessary to create your own component for this,
when JButton already has a constructor that takes an Icon (a picture) as its
parameter. All you need to know is how to make a GIF file into an icon, and
that's
frame.getToolkit().getImage("your.gif")
where "frame" is the JFrame your components are being put into.
But your question "how you call that class... from another program"
indicates that you don't know Java yet. You don't call a class, you create
objects of a class and call their methods. You might find it better to work
on a less technical project while you are learning, then come back to Swing
once you understand object oriented programming better.
PC2
Dixon <Dixtigger@yahoo.com> wrote in message news:3a7052e8@news.devx.com...
>
> Hi Pro Developer,
>
> I have a professional question about JFC pluggable look
> and feel. I need help on understanding how to create my own
> custom UI component, I've looked at the APIs but I'm not
> too good at writing code by looking at the APIs what I need
> from you is simple sample of a least how to create a custom
> button UI in which you can put a .gif button in place of
> the standard "gray" color java button. and then I need to
> know how you call that class that you already wrote from
> another program and use that class and asign it to
> different button graphic.. like that .gif or .jpg files.
> I will be very happy if you help me on this professional
> question my project is a GUI messanger using graphics
> instead of the standard java colors.
>
> Thanks in advance,
> and I hope to here from you soon.
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks