Posts Tagged ‘html’

Google maps API

Tuesday, February 23rd, 2010

I was checking out Sven’s page, and found his awesome map of trails (“greenlanes”) in his neighborhood.

I have my own map, but this is on my google maps, so not really very user friendly or manageable, so today I decided to try and use the google maps API.

I’m pretty pleased with the result, a single .html file with almost only javascript. Now I can just export the paths and add a single line in the .html file and the new track will be added to the maps and menu. I’m going to add sorting of the tracks by difficulty, length and maybe based on their distance from Trondhiem sometimes later.

The page is very easy to use, and if you want to make a list of tracks (or any form of lines), just check out the page source code which has 3 simple instructions on how to get it working

I probably won’t be adding many tracks until around the start of May.

Dvd collection

Saturday, September 27th, 2008

I tried out a couple of programs for managing your DVD collection lately. The choice fell on eXtreme Movie Manager. Adding movies and tv shows by importing from IMDB worked nicely.

Extreme Movie Manager

I really like the tv series part, where I can list all the tv series I have, order by rating, etc..

You can also export your collection to a html page like this

or to a simple list.

WordPress 2.2.2

Sunday, August 26th, 2007

Just updated the wordpress installation on my site to 2.2.2, it was a breeze with fantastico/cpanel.. only had to re-insert the google analytics code to the footer afterwards.

Also installed the nextgen gallery plugin, which I’m so far pretty pleased with (you can see the result by choosing gallery in the right menu).

I had the same “problem” as my friend Håvard.  The norwegian characters æ ø å got messed up with the update, but only had them in 1 single post, so not much to update :) he was much worse having all posts in Norwegian :)

using a large JLabel in a JScrollPane

Thursday, August 23rd, 2007

I was updating the SendSMS program I wrote, and instead of a JTable I wanted the list of messages sent to display in a better looking and more intuitive way. I decided to just use a JLabel and use html for displaying the sent messages:

JLabel using html in JScrollPane

I had the JLabel in a JPanel with GridLayout(1,1), and the Panel inside the JScrollPane. The JScrollPane always have vertical but never horizontal scrollbars.
The following problem arose: When the message got to long, it would not wrap, and end of message would disappear to the right.
The solution is simple: set the Width of the JPanel with the label to be roughly the size of the application window..

That did the trick, now however the scrollbar never updates when the Label gets very tall.

Apparently you cant just set just width for the Panel, you also have to set height.. again the solution is simple, set the height of the panel to be the height of the JLabel.

However since the JLabel is inside the JScrollPane (at least, I think that is the cause) the getSize and getPrefferedSize will return only the visible height of the JLabel. It took some playing around with but finally got it working by using the getMaximumSize.. NOTE: dont use the width from getMaximumSize() cause it is ridiculously large :)

the code:

historyPanel.setPreferredSize(new Dimension(historyScrollPane.getViewport().getSize().width, historyLabel.getMaximumSize().height));

Now I just have to find out if that way of getting the components height works the same across different platforms :)

Current events

Sunday, March 25th, 2007

Haven’t posted much lately.. Things have been pretty busy with work and the moving (only 6 days left, yaaaaay!), I’ve had almost no time for UFO Afterlight or Silent Hunter 4 the last 2 weeks, and I don’t expect I will have much time for C&C 3 when it is released next week.

I took out my scooter today, drove around a bit.. took like half an hour to start the bastard after it being in storage for 5 months this winter. I’m looking forward to not taking the bus to work tomorrow :)

The other thing that has kept me busy lately is that I have been making a new webpage (that combines aakretech.no, .com, .net and .org into a single page). Not quite done yet but most of the pages are in place. Removing the cocoon webapp for aakretech.org from my Tomcat server reduced the server’s startup time from 15 seconds to 0.7 seconds.

Not much more to say really.. Nemi got her new cage, but we wont get it for her until we move next Sunday/Monday
ferret nation