Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #3635
| From | "Boris" <boris@THRWHITE.remove-dii-this> |
|---|---|
| Subject | help in creating customiz |
| Message-ID | <10a4285b-a07c-42de-8652-d8443ee307fa@w5g2000prd.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| Date | 2011-04-27 15:46 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui
I am trying to make buttons similar to one like in Windows media
player 11 . I have been able to create previous button by clipping
RoundRectangle2D.Float with the original component . But I can not
figure out how to create next button as in Windows media player ,
which is like a rectangle with an arc on the right side . I Hope I
have clearly explained my problem . I just need to know how to create
the shape .Please help.
I have a class which extends JButton.
Here's the code for previous button shape ( rectangle with an arc on
the left ) : -
[code]
//overriding paintcomponent()
Graphics2D g2d = (Graphics2D) g;
int w= getWidth(),h=getHeight();
RoundRectangle2D.Float r2d = new
RoundRectangle2D.Float( 0, 0, w+30 , h , 20, 20);
g2d.clip(r2d);
g2d.setPaint(gp);
g2d.fillRect(0, 0, w, h);
[/code]
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next | Find similar | Unroll thread
help in creating customiz "Boris" <boris@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
csiph-web