public class NetPhantomStarter extends Panel implements ActionListener, WindowListener, KeyListener, MouseListener, AuthCB, com.netphantom.starter.IDesktop
NetPhantom applications can be launched by double-clicking a .nps file on Windows, macOS,
or Linux (GNOME/KDE Plasma). The .nps file is an XML document with the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<NetPhantomStarterLinks xml:space="preserve" version="8.0">
<Link title="My Application"
destination="https://server.example.com/app"
pin="true"
shortcutDir="C:/Users/user/Desktop"
iconFile="my-icon.ico"
jvmOptions="-Xmx512m -Dfoo=bar"
classPath="lib/extra.jar:lib/util.jar"
className="com.example.MyClass"
removeScript="unpin-my-app.bat">
<Arguments>
<Arg>[netphantom-client-arg...1]</Arg>
<Arg>[netphantom-client-arg...2]</Arg>
<Arg>[netphantom-client-arg...3]</Arg>
<Arg>...etc...</Arg>
</Arguments>
<IconFileInfo UTC-time="2026-01-03T12:00:00Z"
timestamp="1735905600000"
size="4286"
crc32="1234567890"/>
</Link>
</NetPhantomStarterLinks>
<NetPhantomStarterLinks>xml:space="preserve" - Preserves whitespace in the document.version - The XML format version (currently "8.0").<Link>Each <Link> element defines a NetPhantom application shortcut or taskbar/dock pin:
| Attribute | Required | Description |
|---|---|---|
title | Yes | Display name of the shortcut or pin. |
destination | No | Server URL or destination specification for the application. |
pin | No | Set to "true" for taskbar/dock pin; omitted for desktop/folder shortcuts. |
shortcutDir | No* | Directory path for shortcut placement (omitted when pin="true"). |
iconFile | Yes | Icon filename, relative to the icons folder (e.g., "my-app.ico"). |
jvmOptions | No | Space-separated JVM options (e.g., "-Xmx512m -Dfoo=bar"). |
classPath | No | Additional classpath entries (":" or ";" separated). |
className | No | Fully qualified class name to execute. |
removeScript | Yes | Undo/remove script filename, relative to the links folder. |
<Arguments>Optional container for program arguments. Contains zero or more <Arg> child elements,
each holding a single command-line argument as text content:
<Arguments>
<Arg>--verbose</Arg>
<Arg>--config=prod.xml</Arg>
</Arguments>
<IconFileInfo>Optional metadata about the icon file for validation purposes:
| Attribute | Description |
|---|---|
UTC-time | Human-readable UTC timestamp (ISO-8601 format). |
timestamp | File last-modified time in epoch milliseconds. |
size | File size in bytes. |
crc32 | CRC32 checksum of the file (optional). |
{user.home}/{user.name}/.NetPhantom8/links/np-links.xml{user.home}/{user.name}/.NetPhantom8/icons/{user.home}/{user.name}/.NetPhantom8/links/| Platform | Shortcut Type | Implementation |
|---|---|---|
| Windows | .lnk files, Taskbar pins | Shortcut-and-Pin.exe (x64/ARM64) |
| macOS | Dock pins, Folder aliases | Create-Shortcut.zsh script |
| Linux (GNOME) | .desktop files | gnome-Create-Shortcut.sh script |
| Linux (KDE Plasma) | .desktop files | kde-plasma-Create-Shortcut.sh script |
Panel.AccessibleAWTPanelContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
NetPhantomStarter() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Performs action requested by the selection of a push button.
|
boolean |
confirmQuit()
Confirm the quitting of the application for macOS.
|
String[] |
getAuth(boolean usesSSL,
boolean isProxy,
String serverName,
String scheme,
String realm,
String resource,
String userID,
String password)
Requests a password.
|
boolean |
hasPreferencesDialog()
Has preferences dialog for macOS?
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
static void |
main(String[] arg)
This method starts execution of the Starter.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics g) |
void |
showAboutDialog()
Show the about dialog, called from AWT.
|
void |
windowActivated(WindowEvent e) |
void |
windowClosed(WindowEvent e) |
void |
windowClosing(WindowEvent e)
Window is closed.
|
void |
windowDeactivated(WindowEvent e) |
void |
windowDeiconified(WindowEvent e) |
void |
windowIconified(WindowEvent e) |
void |
windowOpened(WindowEvent e) |
addNotify, getAccessibleContextadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static void main(String[] arg)
The program can be started with optional parameters, some of which consists of a switch followed by one or more values. The switch must be preceded by a '-' (dash) or a '/' (forward slash). The switch can be given in upper or lower case.
The following parameters are accepted:
baseURL -C startClass -A arg1 [arg2 [argN]]where:
arg - Any command line parameters.public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - The action event.public void windowClosing(WindowEvent e)
windowClosing in interface WindowListenerpublic void windowOpened(WindowEvent e)
windowOpened in interface WindowListenerpublic void windowClosed(WindowEvent e)
windowClosed in interface WindowListenerpublic void windowActivated(WindowEvent e)
windowActivated in interface WindowListenerpublic void windowDeactivated(WindowEvent e)
windowDeactivated in interface WindowListenerpublic void windowIconified(WindowEvent e)
windowIconified in interface WindowListenerpublic void windowDeiconified(WindowEvent e)
windowDeiconified in interface WindowListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListenerpublic void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic String[] getAuth(boolean usesSSL, boolean isProxy, String serverName, String scheme, String realm, String resource, String userID, String password)
The following parameters indicates how the process is handled:
server = null,
realm = null,
resource = certificateFileName
server = protocol://serverName[:port],
realm = null,
resource = null
server = protocol://serverName[:port],
realm = realmString,
resource = null
The parameters "userID" and "password" are set to null if no previous data is present, otherwise the previous userID (always null for certificate files) and the previous password.
public void showAboutDialog()
showAboutDialog in interface com.netphantom.starter.IDesktoppublic boolean confirmQuit()
confirmQuit in interface com.netphantom.starter.IDesktoptrue if the quitting is allowed, false otherwise.public boolean hasPreferencesDialog()
hasPreferencesDialog in interface com.netphantom.starter.IDesktoptrue if the preferences dialog is available, false otherwise.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© 2026 Mindus SARL. All rights reserved.