Results 1 to 5 of 5
Thread: java(opaque)
- 11-10-2008, 05:45 PM #1
Member
- Join Date
- Nov 2008
- Location
- Kuala Lumpur,Malaysia
- Posts
- 16
- Rep Power
- 0
- 11-10-2008, 05:51 PM #2
Dictionary.com
1. not transparent or translucent; impenetrable to light; not allowing light to pass through.
4. hard to understand; not clear or lucid; obscure: The problem remains opaque despite explanations.
I'm assuming it means the panes below cannot be seen.
Using Top-Level Containers
If you create your own content pane, make sure it's opaque. A JPanel object makes a good content pane because it's simple and it's opaque, by default. Note that the default layout manager for JPanel is FlowLayout; you'll probably want to change it. To make a component the content pane, use the top-level container's setContentPane method. For example:
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
contentPane.setBorder(someBorder);
contentPane.add(someComponent, BorderLayout.CENTER);
contentPane.add(anotherComponent, BorderLayout.SOUTH);
topLevelContainer.setContentPane(contentPane);
Note: Don't use non-opaque containers such as JScrollPane, JSplitPane, and JTabbedPane as content panes. A non-opaque content pane results in messy repaints. Although you can make any Swing component opaque by invoking setOpaque(true) on it, some components don't look right when they're completely opaque. For example, tabbed panes generally let part of the underlying container show through, so that the tabs look non-rectangular. So an opaque tabbed pane just tends to look bad.
- 11-11-2008, 03:38 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
In other words, every pixel of a component is painted within its bounds.
- 11-12-2008, 06:27 PM #4
Member
- Join Date
- Nov 2008
- Location
- Kuala Lumpur,Malaysia
- Posts
- 16
- Rep Power
- 0
Thanks for your explanations...it helps me a lot......
- 11-13-2008, 03:32 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
If you have found the solution for your question, please mark the thread solved from the Thread Tools.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks