public interface FrameBuilder
A builder for a JFrame.
-
Method Summary
Modifier and TypeMethodDescriptionalwaysOnTop(boolean alwaysOnTop) build()centerFrame(boolean centerFrame) This is overridden bylocation(Point)or by setting thelocationRelativeTo(Component)component.component(@Nullable JComponent component) Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTERcomponentListener(ComponentListener componentListener) defaultCloseOperation(int defaultCloseOperation) DefaultWindowConstants.DISPOSE_ON_CLOSE.extendedState(int extendedState) focusableWindowState(boolean focusableWindowState) Clears any icon images previously set viaiconImage(Image)oriconImages(List)iconImages(List<Image> iconImages) OverrideslocationRelativeTo(Component)andcenterFrame(boolean).locationRelativeTo(@Nullable Component locationRelativeTo) onClosed(Consumer<WindowEvent> onClosed) onClosing(Consumer<WindowEvent> onClosing) onOpened(Consumer<WindowEvent> onOpened) resizable(boolean resizable) show()Builds and shows a JFrame based on this buildertitle(@Nullable Observable<String> title) windowListener(WindowListener windowListener)
-
Method Details
-
component
Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTER- Parameters:
component- the component to display- Returns:
- this builder instance
-
title
- Parameters:
title- the title- Returns:
- this builder instance
-
title
- Parameters:
title- an observable for a dynamic dialog title- Returns:
- this builder instance
-
icon
Clears any icon images previously set viaiconImage(Image)oriconImages(List)- Parameters:
icon- the icon- Returns:
- this builder instance
-
iconImage
- Parameters:
iconImage- the icon image- Returns:
- ths builder instance
- See Also:
-
iconImages
- Parameters:
iconImages- the icon images- Returns:
- ths builder instance
- See Also:
-
size
- Parameters:
size- the size- Returns:
- this builder instance
-
resizable
- Parameters:
resizable- true if the frame should be resizable- Returns:
- this builder instance
-
alwaysOnTop
- Parameters:
alwaysOnTop- true if the frame should always be on top- Returns:
- this builder instance
- See Also:
-
focusableWindowState
- Parameters:
focusableWindowState- the focusable window state- Returns:
- this builder instance
- See Also:
-
location
OverrideslocationRelativeTo(Component)andcenterFrame(boolean).- Parameters:
location- the frame location- Returns:
- this builder instance
-
locationRelativeTo
- Parameters:
locationRelativeTo- the component to which the location should be relative- Returns:
- this builder instance
-
onOpened
- Parameters:
onOpened- called when the frame has been opened- Returns:
- this builder instance
-
onClosed
- Parameters:
onClosed- called when the frame has been closed- Returns:
- this builder instance
-
onClosing
- Parameters:
onClosing- called when the frame is about to be closed- Returns:
- this builder instance
-
defaultCloseOperation
DefaultWindowConstants.DISPOSE_ON_CLOSE.- Parameters:
defaultCloseOperation- the default frame close operation- Returns:
- this builder instance
-
extendedState
- Parameters:
extendedState- the extends state- Returns:
- this builder instance
- See Also:
-
centerFrame
This is overridden bylocation(Point)or by setting thelocationRelativeTo(Component)component.- Parameters:
centerFrame- true if the frame should be centered in on the screen- Returns:
- this builder instance
-
windowListener
- Parameters:
windowListener- a window listener- Returns:
- this builder instance
-
componentListener
- Parameters:
componentListener- the component listener- Returns:
- this builder instance
-
onBuild
- Parameters:
onBuild- called when the frame has been built.- Returns:
- this builder instance
-
build
JFrame build()- Returns:
- a JFrame based on this builder
-
show
JFrame show()Builds and shows a JFrame based on this builder- Returns:
- a JFrame based on this builder
-