Friday, October 5, 2012

Netbeans: Changing OSX Menu Bar Title

Problem: When I run my jar on Mac OS, the menu bar has a weird name, like "main.HelloWorld". How do I change it?

Solution: The easiest way I've found is to do it programmatically in java. This way you bypass having to worry about giving the Java VM any special Xdock:name parameters. Details are on this forum post.

Monday, October 1, 2012

Netbeans: Wrapping text in a jEditorPane (contained within a jScrollPane)

Problem: I've managed to set the content of my jEditorPane using the contentType property (which I simply changed from "text/plain" to "text/html") and the page property (for which I inserted "getClass().getResource("/file/path")" to the Custom code area). But now when I run the application, the jFrame is stretched wide and the text doesn't wrap.

Solution: Selecting the jScrollPane in the Navigator, you need merely to set the preferred size to 0,0 and it takes care of itself!

Welcome to norklog

My goal with this blog is to post solutions that I find to the programming conundrums. Aside from serving as a catalog of known solutions, I hope it might also serve to help others who face similar problems.