Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-02-2007, 11:20 AM
Member
 
Join Date: Oct 2007
Posts: 21
unhurt is on a distinguished road
weird looking shape JButton is it possible?
hi, im want to make a non rectangular shape button is it any possible? shapes like pentagon, maybe slanted on the side of maybe a 'L' shape button
if by using graphic and draw will it still have the same look and feel of a JButton and a function of a JButton?? how is it done?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-02-2007, 11:30 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Check this thread:

Swing [Archive] - changing the look of a jbutton
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-02-2007, 12:08 PM
Member
 
Join Date: Oct 2007
Posts: 21
unhurt is on a distinguished road
ah, my bad for not searching the forums first lol, and THANKS for the link
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-02-2007, 01:28 PM
Member
 
Join Date: Oct 2007
Posts: 21
unhurt is on a distinguished road
hey JavaBean do u know why as i can't run the applet on the web or compile and run the .java file from

Lightweight Components
under round button

i keep getting this

J:\Java\test>javac ExampleApplet.java
ExampleApplet.java:35: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button1 = new RoundButton("Button 1");
^
ExampleApplet.java:35: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button1 = new RoundButton("Button 1");
^
ExampleApplet.java:38: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button2 = new RoundButton("Button 2");
^
ExampleApplet.java:38: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button2 = new RoundButton("Button 2");
^
ExampleApplet.java:41: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button3 = new RoundButton("Java is Cool!");
^
ExampleApplet.java:41: cannot find symbol
symbol : class RoundButton
location: class actual.ExampleApplet
RoundButton button3 = new RoundButton("Java is Cool!");
^
6 errors

as long as i have the
package actual;
and
import actual.*;

what am i suppose to do to run them??
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-02-2007, 01:38 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
The compiler can not find RoundButton class. Remove package instruction from RoundButton class, place both codes in the same directory and try to compile. It should work..
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 11-02-2007, 02:01 PM
Member
 
Join Date: Oct 2007
Posts: 21
unhurt is on a distinguished road
well i comment on the package and i got this

J:\Java\test>java RoundButton
Exception in thread "main" java.lang.NoSuchMethodError: main

i did put them all in the same directory, im just missing the picture they mention in exampleapplet

background = parentApplet.getImage(parentApplet.getCodeBase(), "actual/images/scott.jpg");

am i doing this right? i try running in appletviewer app.html but nothing
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 11-02-2007, 02:15 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
You can download the image too. Append that relative path to the path of the applet and download image with your browser.

You will not run RoundButton, it is an auxiliary class. You will run applet class using appletviewer.exe! But appletviewer uses html as parameter so you will need to download html file and modify it to point to the local path...

I recommend you to create a very simple swing application using that RoundButton. Just write your JFrame with a regular JButton. Once yo uare sure that it is working, place RoundButton to the same directory, replace JButton words with RoundButton, recompile and rerun to see the result. That might be easier for you if you did not develop an applet before.

Last edited by JavaBean : 11-02-2007 at 02:18 PM.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 11-03-2007, 08:59 AM
Member
 
Join Date: Oct 2007
Posts: 21
unhurt is on a distinguished road
i change all the JButton into the RoundButton, it works but is the result produce this way and running it through the applet any different? im getting a line drawn round circle and the text inside it looks crude lol, i haven try the thread u provided fully yet, am getting down to things now.
so in the end i just want to know, can i still get the same look and feel of a standard JButton? with the same gradiant colour, emboss and able to get actionlistener ??
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 11-03-2007, 10:10 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
I did not use that class. I dont know the result.

Quote:
can i still get the same look and feel of a standard JButton? with the same gradiant colour, emboss and able to get actionlistener ?
That should be possible but you might need to hack the source code of JButton..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help, weird question kinda. carlos123 New To Java 6 01-22-2008 04:19 AM
implementing shape sidkdbl07 Java 2D 1 01-12-2008 07:42 PM
Weird data output Shaolin New To Java 12 12-11-2007 05:27 PM
Help with Move Shape romina AWT / Swing 1 08-07-2007 06:27 AM
How to change shape of JButton FaRuK AWT / Swing 1 05-19-2007 01:56 PM


All times are GMT +3. The time now is 05:08 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org