Mark Dary

Greenhorn
+ Follow
since Jan 16, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Dary

Hi all, I have several issues with spinners and date editors.

The main objectives I have are:

a spinner for hours and minutes
set foreground color (eg green) while editing
set foreground color (eg black) when finished
do not allow invalid edits OR set foreground color (eg red) if invalid

My first issue is that when I enter a number manually (eg 1) without the spinner controls, the hours jump 4 at a time.

The second main issue is how to set the foreground color while editing.

I have the following stipped down version, but don't know how to take it further, can anyone help?




Thanks.

Mark.
14 years ago
Hi all

Sorry, but my original example is wrong, possibly a misunderstanding.

If I have the following data in 3 columns:



After sorting I want:



The example I tried earlier does not seem to work.

Any ideas?



15 years ago
Thanks all

I got it working with your help, for example:


So now each time the table is refreshed (quite regularly with external data), the columns are automatically sorted in the order I want (3, 7, 2 for example).

My next query is how to implement user defined mulit-column sorting, eg Ctrl-click column 2, 6, 5 for example to sort by column 2, then 6 then 5?

Thanks again.

Mark.
15 years ago
H all

I have two table sorting queries.

First is how can I set the default sorting column before the table is first displayed.

And secondly, how can I implement multi-column sorting, for example on column 3, then column 2 then column 6 for example?

Any help appreciated.

Thanks.

Mark.
15 years ago
Thanks very much for this Michael

I will have a play with it.

Thanks again.

Mark.
15 years ago
Thanks Michael

Unfortunately I also need hours, minutes and seconds but I gave an example with just 3 spinners (instead of six).

My main query is how to ensure each one uses (and updates itself) with the same datemodel?

Any ideas?

Mark.
15 years ago
Hi all

I want something like the following to show the same date in 3 different spinners so I can spin through days or months or years:



But this dosen't seem to work, can anyone help?

Thanks.

Mark.
15 years ago
OK, thanks for your help so far Martijn.

Let's hope the Swing experts can help, it's still giving me a BIG headache

Mark.
15 years ago
Thanks for all the feedback so far.

Yes, the idea does make sense but my understanding is that the resourceMap already provides the context, that's how it can get the icon files.

Maybe I can't see the wood for the trees, I am brain dead trying to figure this one out, I just can't make any progress

Any other ideas?

Thanks.

Mark.
15 years ago
Yep I tried, it would be nice but it returns wtih FileNotFound
15 years ago
Oh God no!

This works fine, but it is just a temporary workaround.

I have a resource map in a Swing Application Framework that works perfectly with text and icons.

For example in the resource file I have:



Then in the code I have:



But I want to use the resource map to get a reference to my wav file (eg "myError.wav" ) to pass into AudioSystem.getAudioInputStream().

The problem is I don't know how to get a file reference from the resource map, I had a few attempts but just can't get to it.

15 years ago
I found a better way (for my purposes) of using a wav file:



And then to use it:



But I still can't get my own wav file from a resource as explained in my earlier post.

Could anyone help?

Mark.
15 years ago
Hi all

I have a resource map within a Single Frame Application view file, and I can set text and icons using the resource map without problem, eg:

In the resource file:



And then in the code:



My problem is that I want to get a wav file reference to pass into an AudioSystem object. I can test audio stuff as follows:



But I have tried several different ways without success to get a File reference to create the File object for getAudioInputStream.

Could anyone help please?

Thanks.

Mark.
15 years ago
Hi all

Is is possible to return a primitive in getColumnClass.

I was returning int.class but I kept getting errors, so I changed it to an Integer and it seems OK.

I was just curious if it was actually allowed to return a primitive.

Cheers.

Mark.
15 years ago
Hi all

The original code I posted is a complete example (cut,past,compile) to show the problem, the real app has 5 packages with around 100 classes.

I have now changed it so all GUI work is in the EDT (I think) and it works fine.

The next part (I think I'm almost finished) is finding a good synchronization point.

In the original example the makeData() method simulates the raw data that can be received and processed, this can be executed concurrently, anything from 1 to several hundred times.

As I said I think I am almost finished, if anyone is interested I will post a complete example.

Cheers.

Mark.
15 years ago