Archive for August, 2009

August 3, 2009

a question of layout

Well, I still haven’t really got around to doing much actually with Griffon, and we’ll still have to put that off until the next post – this time I want to show a little of the layout we chose to use.

I mentioned before that MigLayout looks to be the best way to go, so I set up a few trials (and errors, of course) and came up with a decent layout with which to start. It’s not the final version, there are a lot more fields to add, but it does show the sort of thing that can be achieved fairly quickly. There is plenty of documentation on the MigLayout website and, of course, the relevant jar to download and it was easy to create the following form:

p45pt3-screen

and all this needed was the following code

import net.miginfocom.swing.MigLayout
application(title:'p45pt3',
//size:[320,480],
pack:true,
//location:[50,50],
locationByPlatform:true,
) {
panel(border:emptyBorder(12),layout:new MigLayout("wrap 4","[100][200][100][200]","")){
  label("name :",constraints:'right')
  textField("enter name", constraints:'wrap, width 150:150:')
  label("reference :",constraints:'right')
  textField("employee reference")
  label("NI number :",constraints:'right')
  textField("nino")
  label("date of birth :",constraints:'right')
  textField("dd-mm-ccyy")
  label("gender :",constraints:'right')
  textField("m/f")
  label("starting date :",constraints:'right')
  textField("dd-mm-ccyy")
  label("job title :",constraints:'right')
  textField("?")
}
}

This is by no means complete, there are no binds, for example, but it shows the layout quite nicely. What we wanted was simply two columns of entry fields, so here’s how it gets there:
1. new MigLayout(“wrap 4″,”[100][200][100][200]” ,”")
there are three arguments: the first is for the layout, here “wrap 4″ means that it will wrap to the next line after four fields (label, textField, label, textField); the second is for column constraints, what “[100][200][100][200]” gives is four columns with those widths (default in pixels); the final argument defines the row constraints, which is null at the moment.
2. add the various labels and textFields, I’ve used mostly defaults except for the “right” on the labels to right-justify the label text, and on the “enter name” textField I’ve used “wrap” to end that row and “width…” to define the actual width of the box (otherwise they are given the size of the initial contents).

I’ll use this style for the full form, but adding a few extra constraints to improve the appearance.

And then tomorrow, I’ll get it actually working…

Tags:
August 1, 2009

a slight digression

Well, it’s not been a good week and Wednesday was particularly bad! So I’ve been delayed with the Griffon work for a couple of days.

Interviews – who needs them ?

At the moment I’m rather, well very, short of money and I have been looking for work, so when I saw a posting on a UK website looking for a developer in, well let’s say, language A, and “experience in B an advantage” and they were developing a “C” package and I can tick all of those boxes,  I sent off my CV, and I received an invitation to to an interview. Now, there was nothing in my CV to suggest that I had a great depth of experience in A nor B, just a couple of years, but I do know the C application very well; however it became apparent very quickly in the interview that they weren’t looking for someone like me and the person they wanted would have had much more experience than I have (and what it says in my CV) but, apparently, they wanted to see me because of the combination – “not many people with that in their CV”, I was “top of their list of fifty CVs, the first we’ve seen”. All very well, but really there was no way they would have employed me based on the type of person they said they were looking for. They did mention just how far I have travelled, more than once – and that’s what really irritated me, they did realise just how long the journey took and how inconvenient it was. And so for the apparent sake of “just having to meet me” they had me travel nearly 400 miles in really bad weather, wasting a day of my time (left at 9.30, back at 19.25), no apologies, no “compensation” just a couple of handshakes and a “thank you”… A right bunch of pillocks, is what comes to mind – well a lot stronger, actually. So I am very annoyed…

NetBeans and the Griffon plugin

I briefly mentioned this in the previous posting but I’d only heard that there was a new version that day and hadn’t had much opportunity to have a look at it. I’ll be getting back to it now, but so far it looks absolutely fine. I noticed that the plugin (the previous version, actually) did get a lot of use at JavaOne including in a few demos. Certainly I’ll be using it my work now.

Follow

Get every new post delivered to your Inbox.