Results 1 to 5 of 5

Thread: Providing application skins for java applications

  1. #1

    Thread Starter
    Banned debbie_82's Avatar
    Join Date
    Jan 2004
    Location
    inside a hollow void
    Posts
    104

    Providing application skins for java applications

    How do I go about specifying my own skin for my components (like I will specify it's own look and feel)...
    It's got to do with graphics isn't it... I really don't know what to do
    just yet...can anyone help me... What is the difference between Graphics2D and Graphics Class in Java...? And what is double buffering? Anybody pls help.

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Is this what you are looking for? Note that to update a component once is has already been created the updateUI() method from JComponent can be used. To update the whole GUI after changing the look and feel use the static method updateComponentTreeUI() from the SwingUtilities class.
    Code:
     try{
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     }(Exception e){
      System.out.println("Could not use the native platform look and  feel: " + e);
     }

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Sorry i forgot about the other questions. Double Buffering is just used to speed up the process of rendering the components. The updating of any components is done in an off-screen buffer then once all the rendering is done they are copied to the screen. You can turn Double Buffering off by using void setDoubleBuffered(boolean flag). You can also check to see if a component is buffered by calling boolen isDoubleBuffered()

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Graphics2D is a class that provides added abilities for drawing, especially 2D transformations. The Graphics object that is passed to paint is always a Graphics2D in Java 1.2 upwards (I think, maybe 1.3).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Banned debbie_82's Avatar
    Join Date
    Jan 2004
    Location
    inside a hollow void
    Posts
    104
    Originally posted by CornedBee
    Graphics2D is a class that provides added abilities for drawing, especially 2D transformations. The Graphics object that is passed to paint is always a Graphics2D in Java 1.2 upwards (I think, maybe 1.3).
    Is using Graphics 2D classes make the program slower?

    The one I made was very slow... I wonder if its due to the graphics... I haven't added any functionalities yet because it's the gui part of the program.. I'm wondering what could be making this one really slow.

    Here is my project which I made using JBuilder. Also there is some problem with painting of some components...

    I'm a newbie in java and I'm not quite sure why this program is really slow... Even using P4 processor 1.8ghz and 512mb memory it's still slow.. In my computer its 256mb...

    Please any help is greatly appreciated.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width