Skip to main content

synth lookandfeel

1 reply [Last post]
bune
Offline
Joined: 2006-05-23
Points: 0

Hi

i'm trying to set up a synth lookandfeel for my app and got some problems due to the very slim documentation. in general everything works fine, but i have some problems to embed objects, is it still buggy or do i make a mistake? here's my code:

xml file:

</p>
<p>[...]</p>
<p>

the gradientpainter:

<br />
package Client;<br />
import java.awt.*;<br />
import javax.swing.*;<br />
import javax.swing.plaf.synth.*;</p>
<p>public class GradientPainter extends SynthPainter<br />
{<br />
    public void paintPanelBackground(SynthContext context,<br />
                                          Graphics g, int x, int y,<br />
                                          int w, int h)<br />
    {<br />
        Graphics2D g2 = (Graphics2D)g;<br />
        g2.setPaint(new GradientPaint((float)x, (float)y, new Color(36,44,83),<br />
                   (float)(x + w), (float)(y + h), new Color(64,78,149)));<br />
        g2.fillRect(x, y, w, h);<br />
        g2.setPaint(null);<br />
    }<br />
}<br />

any help would be much appreciated, thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
luke_sleeman
Offline
Joined: 2006-06-26
Points: 0

Not sure about your problem in particular, but I do know the synth look and feel seems to be a bit 'hard to use' to say the least. If I remember correctly, Romain Guy was doing some work with it, a while ago, you might want to try searching through his blog:
http://jroller.com/page/gfx

AFAIK he also has a blog on java.net, but I cant remember where it is...

- Luke