?
Solved

tabbedpane background color

Posted on 2005-05-12
6
Medium Priority
?
255 Views
Last Modified: 2012-06-27
i cant get this to work..

        tabbedPaneNews.setBackgroundAt(0,new java.awt.Color(229,238,249));

the foreground function works fine but not the background..i have just one tabbedpane..and i need it to show a ifferent background color..
0
Comment
Question by:trance12
  • 3
  • 2
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 13984239
that should work ok
can you post the rest of your code

perhaps you are not setting the bvackground on the same tabbed pane object that is displayed
0
 

Author Comment

by:trance12
ID: 13984246
Thanks

final JTable userTable = new JTable(calendarTableModel);
       

        TableColumn column1 = userTable.getColumnModel().getColumn(START);
        column1.setWidth(columnSizes1[START]);
        column1.setMaxWidth(columnSizes1[START]);
        column1.setMinWidth(columnSizes1[START]);
        column1.setResizable(false);
       
       
        column1 = userTable.getColumnModel().getColumn(EXPERIENCE);
        column1.setWidth(columnSizes1[EXPERIENCE]);
        column1.setMaxWidth(columnSizes1[EXPERIENCE]);
        column1.setMinWidth(columnSizes1[EXPERIENCE]);
        column1.setResizable(false);
       
       
       
        column1 = userTable.getColumnModel().getColumn(EXPSUB);
        column1.setWidth(columnSizes1[EXPSUB]);
        column1.setMaxWidth(columnSizes1[EXPSUB]);
        column1.setMinWidth(columnSizes1[EXPSUB]);
        column1.setResizable(false);
       
        column1 = userTable.getColumnModel().getColumn(CUSTNO);
        column1.setWidth(columnSizes1[CUSTNO]);
        column1.setMaxWidth(columnSizes1[CUSTNO]);
        column1.setMinWidth(columnSizes1[CUSTNO]);
        column1.setResizable(false);
       
       
       
        column1 = userTable.getColumnModel().getColumn(NAME1);
        column1.setWidth(columnSizes1[NAME1]);
        column1.setMaxWidth(columnSizes1[NAME1]);
        column1.setMinWidth(columnSizes1[NAME1]);
        column1.setResizable(false);
       
        column1 = userTable.getColumnModel().getColumn(DESC);
        column1.setWidth(columnSizes1[DESC]);
        column1.setMaxWidth(columnSizes1[DESC]);
        column1.setMinWidth(columnSizes1[DESC]);
        column1.setResizable(false);
       
       
       
        column1 = userTable.getColumnModel().getColumn(UPD);
        column1.setWidth(columnSizes1[UPD]);
        column1.setMaxWidth(columnSizes1[UPD]);
        column1.setMinWidth(columnSizes1[UPD]);
        column1.setResizable(false);
       
       
        userTable.setBounds(100, 115, 850, 150);
        userTable.setSelectionForeground(new java.awt.Color(255, 255, 255));
        userTable.setSelectionBackground(new java.awt.Color(248, 67, 112));
        JScrollPane scrollPane11 = new JScrollPane(userTable);
        scrollPane11.setBounds(100, 115, 850, 150);
        panel1.add(scrollPane11);
        tabbedPane = new JTabbedPane();
        tabbedPane.setBounds(100, 115, 850, 150);
        panel1.add(tabbedPane);
        tabbedPane.addTab("Calendar",  scrollPane11);
        tabbedPane.setBackgroundAt(0,new java.awt.Color(186,196,227));
        tabbedPane.setForegroundAt(0,new java.awt.Color(255,6,120));
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13984262
Looks OK
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 37

Accepted Solution

by:
zzynx earned 1000 total points
ID: 13984299
Do you want to set the background of
- the tabbed pane: tabbedPane.setBackground(new java.awt.Color(186,196,227))
or
- the tab of the tabbed pane: tabbedPane.setBackgroundAt(0,new java.awt.Color(186,196,227));
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 13984383
0
 
LVL 37

Expert Comment

by:zzynx
ID: 14013871
thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question