Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: taskpane issue - how to change title bgcolor

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default taskpane issue - how to change title bgcolor

    hey , i have wrote the following example code :
    import org.jdesktop.swingx.*;
    import javax.swing.*;
    import java.awt.*;
     
    public class TaskPaneExample{
            public static void main(String[] args)
            {
              SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                  new TaskPaneExample();
                }});
            }
     
            public TaskPaneExample() {
              JFrame frame = new JFrame("TaskPane Example 1");
              frame.add(doInit(), BorderLayout.CENTER);
              frame.setLocationRelativeTo(null);
              frame.pack();
              frame.setVisible(true);
            }
     
            private Component doInit()
            {
              JXTaskPaneContainer taskpanecontainer = new JXTaskPaneContainer();
              taskpanecontainer.setLayout(new VerticalLayout(2));
     
              final JXTaskPane taskpane1 = new JXTaskPane(){
                  public void setCollapsed(boolean w){
                      super.setCollapsed(w);
                  }};
              taskpane1.setTitle("First TaskPane");
              JPanel panel1 = new JPanel();
              panel1.setBackground(Color.red);
              panel1.setSize(100,100);
              taskpane1.add(panel1);
              taskpanecontainer.add(taskpane1);
     
     
              JXTaskPane taskpane2 = new JXTaskPane(){
                  public void setCollapsed(boolean w){
                      super.setCollapsed(w);
                    }};
              taskpane2.setTitle("My Tasks");
              JPanel panel2 = new JPanel();
              panel2.setBackground(Color.blue); 
              panel2.setSize(100,100);
              taskpane2.add(panel2);
              taskpanecontainer.add(taskpane2);
     
              taskpanecontainer.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
     
              return taskpanecontainer;
            }
    }
    what i need are 2 things:
    1. how do i change the bgcolor of the title, i think it is done with the taskpane2.setUI(..) option but i had no luck working with it.

    2. how to set the border between the JXTaskPane and the Jpanel to zero.

    thanks for any help
    Last edited by copeg; March 30th, 2011 at 09:52 AM.


Similar Threads

  1. taskpane issue - how to change title bgcolor
    By yaniv33 in forum Member Introductions
    Replies: 0
    Last Post: March 29th, 2011, 11:41 AM
  2. taking JFrame title into account when calling pack()
    By gib65 in forum AWT / Java Swing
    Replies: 3
    Last Post: October 7th, 2010, 10:19 PM
  3. Change to JOptionPane
    By Liuric in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 1st, 2010, 01:07 AM
  4. About Title border in jscrollpane
    By subhvi in forum AWT / Java Swing
    Replies: 2
    Last Post: December 15th, 2009, 12:45 AM
  5. JFrame, frame's title doesnt appear.
    By chronoz13 in forum AWT / Java Swing
    Replies: 1
    Last Post: November 26th, 2009, 03:38 PM