A Java application/API to control AnyBar instances.
| Flag | Type | Description | Default |
|---|---|---|---|
-?, --help |
Show the available command line flags with descriptions. | ||
-c, -i, --color, --image |
String | The name of the image to display in the AnyBar instance. | "white" |
-h, --host, --ip |
String | The hostname or IP address of the machine running the AnyBar instance. | "localhost" |
-p, --port |
Integer | The port number that the AnyBar instance is running on. | 1738 |
Change AnyBar to green:
java -jar AnyBar4j.jar -c greenChange AnyBar to exclamation on port 1800 of another local machine:
java -jar AnyBar4j.jar -c exclamation -h 10.0.0.42 -p 1800- Create an instance of AnyBar4j, passing in the hostname (string) and port (int) of the AnyBar instance.
- Call
setImage()on the AnyBar4j instance, using one of theAnyBarImageenum values or a custom name, to change the displayed image/color. - Call
close()to close the client socket.
| Name | Value |
|---|---|
DEFAULT_HOST |
"localhost" |
DEFAULT_PORT |
1738 |
| Name |
|---|
| WHITE |
| RED |
| ORANGE |
| YELLOW |
| GREEN |
| CYAN |
| BLUE |
| PURPLE |
| BLACK |
| QUESTION |
| EXCLAMATION |
Change AnyBar to purple:
AnyBar4j anybar = null;
try {
anybar = new AnyBar4j(AnyBar4j.DEFAULT_HOST, AnyBar4j.DEFAULT_PORT);
anybar.setImage(AnyBarImage.PURPLE);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (anybar != null) {
anybar.close();
}
}In the above instance, you may substitute the AnyBar4j constructor with an empty constructor to connect to the default host and port:
anybar = new AnyBar4j(AnyBar4j.DEFAULT_HOST, AnyBar4j.DEFAULT_PORT);
// Same as
anybar = new AnyBar4j();