Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Sluggish Java Swing Gui

  • 22-03-2004 02:14PM
    #1
    Closed Accounts Posts: 364 ✭✭


    Im having a small problem with my Swing app in java. i have defined a load of JLabels and embedded html into their string variables to colour their text. like so..

    JLabel one = new JLabel("<html><font color=blue>Press me</font></html>");

    And this has made the GUI much slower to repaint. Anyone have any other ways I can colour the text in my buttons?

    Ta


Comments

  • Closed Accounts Posts: 7,562 ✭✭✭leeroybrown


    I havn't used Java in ages but off the top of my head could you use a Font object to create coloured labels?


  • Registered Users, Registered Users 2 Posts: 3,548 ✭✭✭Draupnir


    yeah mate, im positive you can change the color without HTML


  • Closed Accounts Posts: 302 ✭✭Auburn


    I think you can do something like:
    JButton butt= new JButton("butt");
    butt.setForeground(Color.blue);
    


Advertisement