med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

360
active users

#java

28 posts23 participants2 posts today

Last Easter, I was running a checkpoint at Imbil as I’ve done before… operating a checkpoint at Derrier Hill Grid with horses passing through from three different events simultaneously, coming from two different directions, and getting more confused than a moth in a light shop. At that time I thought it’d be really handy to have a software program that could “sort ’em all out”. I punch in the competitor numbers, it tells me what division they’re in and records the time… I then assign the check-points and update the paperwork.

We have such a program, a VisualBASIC 6 application written by one of the other amateurs, however I use Linux. My current tablet, a Panasonic FZ-G1 Mk1, won’t run any supported version of Windows well (Windows 10 on 4GB RAM is agonisingly slow… and it goes out of support in October anyway), but otherwise would be an ideal workhorse for this, if I could write a program.

So I rolled up my sleeves, and wrote a checkpoint reporting application. Java was used because then it can be used on Windows too, as well as any Linux distribution with OpenJDK’s JRE. I wanted a single “distribution package” that would run on any system with the appropriate runtime, that way I wouldn’t need a build environment for each OS/architecture I wanted to support.

One thing that troubled me through this process… was getting image resources working. I used the Netbeans IDE to try and make it easier for others to contribute later on if desired: it has a GUI form builder that can help with all the GUI creation boilerplate, and helps keep the project structure more-or-less resembling a “standard” structure. (This is something that Python’s tkinter seriously lacks: a RAD tool for producing the UIs. The author of the aforementioned VB6 software calls it “T-stinker”, and I find it hard to disagree!)

Netbeans defaults to using the Maven build system for Java projects, although Ant and Gradle are both supported as well. (Not sure which one of the three is “preferred”, I know Android often use Gradle… thoughts Java people?) It also supports adding bitmap resources to a project for things like icons. I used some icons from the GTK+ v3 (LGPLv2) and Gnome Adwaita Legacy (CCBYSA3) projects.

The problem I faced, was actually using them in the UI. I was getting a NullPointerException every time I tried setting one, and Netbeans’ documentation was no help at all. It just wasn’t finding the .png files no matter what I did:

2025-06-15T06:32:54.461Z [FINEST] com.vk4msl.checkpointreporter.ui.ReporterForm: Choose nav tree node testException in thread "AWT-EventQueue-0" java.lang.NullPointerException        at javax.swing.ImageIcon.<init>(ImageIcon.java:217)        at com.vk4msl.checkpointreporter.ui.event.EventPanel.initComponents(EventPanel.java:239)        at com.vk4msl.checkpointreporter.ui.event.EventPanel.<init>(EventPanel.java:63)        at com.vk4msl.checkpointreporter.ui.ReporterForm.showEvent(ReporterForm.java:895)        at com.vk4msl.checkpointreporter.CheckpointReporter.showEntity(CheckpointReporter.java:532)        at com.vk4msl.checkpointreporter.ui.ReporterForm.navTreeValueChanged(ReporterForm.java:480)        at com.vk4msl.checkpointreporter.ui.ReporterForm.access$100(ReporterForm.java:70)        at com.vk4msl.checkpointreporter.ui.ReporterForm$2.valueChanged(ReporterForm.java:182)

Maybe it’s my search skills, or the degradation of search, but I could not put my finger on why it kept failing… the file was where it should be, the path in the code was correct according to the docs, why was it failing?

Turns out, when Maven does a build, it builds all the objects in a target/classes directory. When Netbeans runs your project, it does so out of that directory. Maven did not bother to copy the .png files across, because Netbeans never told it to.

I needed the following bit of code in my pom.xml file:

       <resources>         <resource>           <targetPath>com/vk4msl/checkpointreporter/ui/components/icons</targetPath>           <directory>${project.basedir}/src/main/java/com/vk4msl/checkpointreporter/ui/components/icons</directory>           <includes>             <include>**/README.md</include>             <include>**/*.png</include>           </includes>         </resource>       </resources>

That tells Maven to pick up those .png files (in the com.vk4msl.checkpointreporter.ui.components.icons package) and put them, along with the README.md, in the staging directory for the application. Then Java would be able to find those resources, and they’d be in the .jar file in the right place.

Other suggestions have been to move the project to using Ant (which was the old way Java projects were built, but seems to be out of favour now?)… not sure if Gradle has this problem… maybe some people more familiar with Java’s build systems can comment. This is probably the most serious Java stuff I’ve done in the last 20 years.

I used Java because it produced a single platform-independent binary that could run anywhere with the appropriate runtime, and featured a runtime that had everything I needed in a format that was easy to pick back up. C# I’ve used for command-line applications at university, but I’ve never done anything with Windows Forms, so I’d have to learn that from scratch as well as wrestling MSBuild (yuck!). Python almost was it, but as I say, dealing with tkinter and trying to map that to all the TK docs out there that assume you’re using TCL, made it a nightmare to use. I didn’t want to bring in third-party libraries like Qt or wxWidgets as that’d complicate deployment, and other options like C++, Rust and Go all produce native binaries, meaning I’d have to compile for each platform. (Or force people to build it themselves.)

Java did the job nicely. Not the prettiest application, but the end result is I have a basic Java program, using the classical Swing UI interface that should be a big help at Southbrook later this month. I’ll probably build on this further, but this should go a big way to scratching the itch I had.

https://vk4msl.com/2025/06/15/using-image-resources-with-maven-java-projects-in-netbeans/

Summary card of repository sjlongland/checkpoint-reporter
Codeberg.orgcheckpoint-reporterAmateur radio check-point logging and reporting tool

#Introduction

Hello, my name is Christoff.

I live in Illinois, USA, outside the St. Louis area. Below I'll talk about my technology and creative interests, and a bit about me personally. I'm going to hashtag the heck out of this post.

the whole "deadbeef" thing is the magic number from #Solaris for freed memory. I simply chose .monster TLD because it seemed cool and I like "extended" TLDs.

#Technology

I have been using a OpenBSD, #NetBSD, or #GNU/#Linux since the late 1990s as a primary workstation. I used macOS from 2020 to 2025, switching to the #KDE neon distro (KDE plasma is amazing and KDE isn't bloated anymore, yay!).

My current career is as a #pentester where I break into web applications, IP networks, mobile applications (especially #Android), and people to their face or over the phone; code #malware; write documentation; and enjoy helping clients in a third party contractor/consultant role. I started that job change in 2020, when I earned the #OSCP certification at the height of "#infosec twitter" when I did well there.

Previously I worked for about 20 years as a senior-level programmer, and systems, infrastructure, and database administrator. Burnout was very real and I was extremely bored/unfulfilled.

Now that programming and sysadmin stuff isn't my career, I find I enjoy programming and tinkering again.

I am a big fan of NetBSD and always have been. I am not a huge fan of GNU/Linux but I do appreciate things "just working", even if it is full of closed-source binary blobs and other garbage. It was fun in the 1990s.

I know many programming languages but have been paid professionally to code in #C, #Perl, #Python, #PHP, #Java, and #Groovy for big commercial entities like eBay, small companies, and the US government.

I've maintained 99.99% uptime for a 60MM+ platform for years, including failover and backups (that were regularly tested... you test your failover and backups, right?!).

I always wanted to be a cool C and low-level programmer, which I thought for the longest time was being a kernel programmer, but now I know that isn't the life for me.

Emacs is something I've enjoyed since the beginning and I still can't code a #Lisp well. I'd love to be a cool #lisper with #CommonLisp, but haven't gotten there yet. I'm on the #c64 and #embedded #retrocomputing train now.

#Creative

For creative stuff, I aim to do a lot but tend to hop around as interests take me. I could use some discipline there (someday?).

For #music, I have an electric #bass (Fender Jazz) and electric #guitar. I love #jambands (#GratefulDead, #Phish, #Goose) and that's the type of music I like to play along to.

For #art, I like #acrylic and #watercolor painting. I rarely do it, but think about it a lot and love it when I do it. I don't have any skill or talent, but that's not the point. It's for me and no one else.

For #computing, I am venturing into #C64 #demoscene programming and exploration. Not only was I too poor to get one when I was little but I sorta forgot about it over time. The desire to do cool things in a restricted environment where folks are playing in the sandbox, too, is very exciting and attractive to me. I don't know how to code the #Commodore64 stuff yet, but will! Learning the assembly language (I have zero desire to code in BASIC again and I can just code assembly).

I like #chess, but gave up playing a long time ago. I enjoy following the sport and ChessNetwork (Jerry) is someone I'm a big fan of and got to meet once at a chess club!

#Personal

I live with my soulmate and our five amazing cats in a small town outside St. Louis living a quiet life. Just doing our jobs, taking care of daily life stuff, and enjoying each other and life as much as we can. Ups and downs of life chaos, like anyone else, but we're doing alright!

We enjoy exploring places within driving distance and there are a lot of places to go to.

Currently, we're really into playing two-player games together and just started collecting #boardgames. Right now, we're really digging #SkyTeam, #RoyalGameOfUr, #ForrestShuffle, #SentinelsOfTheMultiverse, and this magnet game I don't know the name of. We have #SpiritIsland and #ArcNova to unwrap and learn. We tried really really hard to get into #ArkhamHorrorTheCardGame but the rules are too complicated and confusing, where it felt like we were doing the wrong thing all the time.

I am 46. I grew up loving Star Wars, Star Trek, #SciFi, reading novels non-stop, horror, and watching movies. I collect classic SciFi books from 1960s and 1970s.

I had two IQ tests as a kid and scored in the genius level. I killed a lot of brain cells from a youth finding myself, grateful for it, but thankfully made it out well. Other than being overweight, my physicals are straight down the middle perfect line (yay, genetics!) and my brain is still in top condition!

I would perhaps describe myself as an extremely curious person, that loves #puzzles and #mysteries, #exploration, figuring out #HumanBehavior like I'm an alien studying humans (I'm good at it, it turns out), that has a keen eye for detail, remembering random little things, and a good listener. I'm fairly adaptable and fluid in most things, which works well for me. My brain works differently than a lot of people, and while frustrating a lot of the time for things I don't understand fully, it is me and serves me well in niches.

Making people laugh makes me happy. I am a #hacker and #tinkerer.

I follow NCAA football #Buckeyes, professional #tennis, and #NFL #ClevelandBrowns. I enjoy it with other people and my other half, but not a huge fan for it solo.

Replied in thread

@WiteWulf

I remember the days when Java was the thing of the future that everyone was surely going to be using instead of all of that C and C++. We were going to have safe sandboxed Java in our WWW browsers, to do away with ActiveX et al..

But even in those days I said that #Oracle was where software goes to die. Clearly Oracle is milking #Java to death.

Which is a bit of a shame.

In the meantime, Microsoft is pushing .NET 8 and no recruiter has Java skills on their checklist.