|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
bb.gui.JPanel2
public class JPanel2
This subclass of JPanel adds exactly one new bit of functionality to its superclass: it is interested in mouse events.
This class was originally written to enable popup menus to be associated with JPanels. This forum posting provides more discussion.
The fundamental reason why this class needed to be written was because, at present, Swing is designed to not pass mouse events to any lightweight component that does not have at least registered mouse listener, a design flaw that has been reported as a bug but which Sun has yet to fix.
Like typical java gui code, this class is not multithread safe:
it expects to only be called by EventQueue
's dispatch thread
.
Nested Class Summary | |
---|---|
static class |
JPanel2.UnitTest
See the Overview page of the project's javadocs for a general description of this unit test class. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JPanel2()
Creates a new JPanel2 with a double buffer and a flow layout. |
|
JPanel2(boolean isDoubleBuffered)
Creates a new JPanel2 with FlowLayout and the specified buffering strategy. |
|
JPanel2(LayoutManager layout)
Create a new buffered JPanel2 with the specified layout manager and a double buffer. |
|
JPanel2(LayoutManager layout,
boolean isDoubleBuffered)
Creates a new JPanel2 with the specified layout manager and buffering strategy. |
Method Summary |
---|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public JPanel2()
JPanel2
with a double buffer and a flow layout.
public JPanel2(boolean isDoubleBuffered)
JPanel2
with FlowLayout
and the specified buffering strategy.
If isDoubleBuffered
is true, the JPanel2
will use a double buffer.
isDoubleBuffered
- a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updatespublic JPanel2(LayoutManager layout)
layout
- the LayoutManager to usepublic JPanel2(LayoutManager layout, boolean isDoubleBuffered)
layout
- the LayoutManager to useisDoubleBuffered
- a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |