Skip to main content

synth lookandfeel

1 reply [Last post]
Joined: 2006-05-23


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:


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.
Joined: 2006-06-26

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:

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

- Luke