Package jahuwaldt.swing
Class StandardMacAboutFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jahuwaldt.swing.StandardMacAboutFrame
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class StandardMacAboutFrame extends javax.swing.JFrame
Java and cross-platform implementation of an About box similar to the standard About panel built into the Cocoa framework on Mac OS X. This implementation is based on aJFrame
. It centers itself automatically on the screen and supports credits in RTF, HTML or plain text formats. MRJ Adapter 1.2 version- Version:
- December 9, 2023, JAH
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description StandardMacAboutFrame(java.lang.String applicationName, java.lang.String applicationVersion)
Construct a standard Mac about frame.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setApplicationIcon(javax.swing.Icon applicationIcon)
Set the icon of the application to be displayed.void
setApplicationName(java.lang.String applicationName)
Set the name of the application to be displayed.void
setApplicationVersion(java.lang.String applicationVersion)
Set the version of the application to be displayed.void
setBuildVersion(java.lang.String buildVersion)
Set the version of the build to be displayed.void
setCopyright(java.lang.String copyright)
Set the coyright text to be displayed.void
setCredits(java.lang.String credits, java.lang.String contentType)
Set the text to be displayed in the credits area of the About frame.void
setCreditsPreferredSize(java.awt.Dimension preferredSize)
Set the preferred size of the credits area of the About frame.void
setHyperlinkListener(javax.swing.event.HyperlinkListener l)
Set the hyperlink listener to be called when hyperlinks are clicked in the credits field.-
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
StandardMacAboutFrame
public StandardMacAboutFrame(java.lang.String applicationName, java.lang.String applicationVersion)
Construct a standard Mac about frame.- Parameters:
applicationName
- the name of the applicationapplicationVersion
- the version string of the application
-
-
Method Detail
-
setApplicationIcon
public void setApplicationIcon(javax.swing.Icon applicationIcon)
Set the icon of the application to be displayed.- Parameters:
applicationIcon
- the icon of the application
-
setApplicationName
public void setApplicationName(java.lang.String applicationName)
Set the name of the application to be displayed. If the application version is null, the string "java" will be shown.- Parameters:
applicationName
- the name of the application
-
setApplicationVersion
public void setApplicationVersion(java.lang.String applicationVersion)
Set the version of the application to be displayed. If the application version is null, the string "Version x.x" will be shown.- Parameters:
applicationVersion
- the version string of the application
-
setBuildVersion
public void setBuildVersion(java.lang.String buildVersion)
Set the version of the build to be displayed. This string appears between parentheses prepended by a "v" immediately after and on the same line as the application version. If the build version is null, the parentheses and "v" are not shown.- Parameters:
buildVersion
- the version string of the build
-
setCredits
public void setCredits(java.lang.String credits, java.lang.String contentType)
Set the text to be displayed in the credits area of the About frame. This area is only visible if the credits string is non-null. The content type must be one of text/plain, text/rtf, or text/html. If the type is text/html and there are hyperlinks in the text, you should register an hyperlink listener with the methodsetHyperlinkListener()
.
- Parameters:
credits
- the credits string to displaycontentType
- the content type of the credits string- See Also:
setHyperlinkListener(javax.swing.event.HyperlinkListener)
-
setCreditsPreferredSize
public void setCreditsPreferredSize(java.awt.Dimension preferredSize)
Set the preferred size of the credits area of the About frame. By default, the preferred size is 100 by 150.- Parameters:
preferredSize
- the preferred size to use
-
setHyperlinkListener
public void setHyperlinkListener(javax.swing.event.HyperlinkListener l)
Set the hyperlink listener to be called when hyperlinks are clicked in the credits field. To remove it, passnull
.- Parameters:
l
- the hyperlink listener
-
setCopyright
public void setCopyright(java.lang.String copyright)
Set the coyright text to be displayed.- Parameters:
copyright
- the copyright text to display
-
-