Java: jCTPbundle – Useful Java Functions and Classes bundled
I decided to bundle some of my (hopefully useful) Java Functions and Classes.
Available in the current Version of the so-called jCTPbundle are the following Packages:
- file – File and Settings-File Functions
- image – Image and Icon Functions
- text – Text(stream) Functions
- gui – GUI Functions, Dialogs, Message Boxes, Text Windows, About Windows etc.
- screen – Screen Functions
- audio – Audio Functions, e.g. Sound-Output and Text to Speech
- math – E.g. Functions to generate random Numbers (int/double) in between Intervalls
- time – Functions about Time and Space
- mac – Mac OS X specific Options
- helper – Some different Functions
I’ve also created an extra Package for Examples:
- examples – Some Examples how to use the Bundle
- resources – Resources for the Examples
Here a small Example: “Display a Filechoser to select a File to remove and remove the Selection subsequently. Display an Information Dialog if the Delection succeeded or not.”:
// import file.FileFunctions;
// import gui.Dialog;
// A Dialog to display if Deletion succeeded or not
Dialog dial = new Dialog();
// Use File Functions to select a File
FileFunctions fileFunc = new FileFunctions();
String file = fileFunc.getFileDialog("");
if((file != null) && fileFunc.removeFile(file)) {
dial.displayInformationMessage("File " +
fileFunc.getFileName(file) +
" successfully removed.", "Success");
} else {
dial.displayErrorMessage("Something went wrong...", "Error");
}
In the Future I will extend and update it.
You can download the jCTPbundle or have a look at the github-Repository.
Hmm… I read blogs on a similar topic, but i never visited your blog. I added it to favorites and i’ll be your constant reader.
Valuable thoughts and advices. I read your topic with great interest.