Andrew Brown

Greenhorn
+ Follow
since Apr 10, 2006
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 Andrew Brown

i have a panel in a main content pane, it contains three radio buttons and takes the focus away from the content pain of the main applet when the radio buttons are pressed. I need to keep the focus on the applets content pane in order to allow the animations i have going on to still be activated by the key listeners.

Set focusable(false); has worked really well for all of the other buttons and textfields i have used, and i have tried setting the panels that the radio buttons are on as false, but alas, no joy.

The radio buttons are also in another class which complicates matters slightly.

Thanks for your continued help

Keep posting.
17 years ago
my previous thread was closed, don't know why? i have an applet with a set of animations that are activated by keys, the focus must stay on the contentPane of the applet in order for the animations to still be activated by the keys.

I have a couple of radioButtons that when i press one of the options the focus remains on the radio button.

I have tried the setFocusable(false); and this is not compatible, anyone got any ideas on this.

ps : - i have used the set focusable false on all the other components and this works fine.
[ May 05, 2006: Message edited by: Andrew Brown ]
17 years ago
i need to know how set a radio button to be non-focusable.

i have tried radioButton.setFocusable(false);

but this does not work.

Any ideas?
17 years ago
it works now, although couldn't find the System.currentTimeMillis() method in the API. I did try that one first, and thought that the get time method would be sufficient, but thanks for pointing me in the right direction. You've all been very helpful.

My recording works a treat now.

Cheers
i have tried to do this policy thing and it stops the exception, i have also tried running it through a local server, which also gets rid of the exception that i am still getting when i compile and run on my machine.

This still doesn't display the images though. i don't understand why this is refusing to work as i have created the JLabel, put an image icon on the JLabel, set the bounds, set it to be visible, and added it to a JPanel. I think that it should be working, but it simply doesn't show the image.

Any more suggestions as i'm losing hope.

Thanks for your continued help. You're all legends.
17 years ago
thank you for your help,

it worked a treat!
17 years ago
Thanks peeps, that was more than helpful.

Cheers
17 years ago
having problems changing a long from a System.currentTimeMillis(); in to an integer.

(It smaller than the time as it's the difference between two times so no worries on the size restrictions)

Cheers
17 years ago
Any one know the code to transform a float into an integer?

Please help!
17 years ago
Does anyone know if i have to imprt a package to use the System.getCurrentTimeMillis() method? it keeps telling me that it wont compile.
thank you for you help but it's not really what i'm looking for, i'm looking to find the differences in time from when a key is pressed until another key is pressed.

The system that i am writing is not a keyboard, so it isn't about how long the note plays for, but about the difference in time because i want to play the notes back with the same gap as when i've played them.

The System.getCurrentTimeMillis(), what does this do? not sure how to use it.

Other things are that i have implemented it in such a way that it compiles, but then simply doesn't work. not sure why because in my opinion it should be working.

any further help will be greatly received.
I am trying to implement recording, this will include timing between notes.

I want to time between two presses of any one of 8 keys and then store the result in an array.

i have tried using getTime, but do not understand how to use it really, it would only compile if i put it in it's own method? then calling the method does not seem to work when i try and add this long to a long array.
[ April 25, 2006: Message edited by: Andrew Brown ]
Thank you very much that was more than helpful.

Dont suppose you know how to undepress the buttons. I have a play mechanism, and at the moment while it is playing, it stays depressed, i want to change it green whilst irt is playing, but it wont undepress whilst its playing.
17 years ago
nb = "null";

bNotesCanvas = new JLabel(nb);

then a separate method saying:

if(event.getSource() == convertButton){
refresh();
}

refresh being:

public void refresh(){
nb = "a";
bNotesCanvas.updateUI();
}

Sorry, didn't think about that.
17 years ago
i am implementing a recording facility for my software, and am trying to implement the buttons so that when the record button is pressed, a boolean is switched and the colour of the buttons back ground is set top red.

This all works fine, but when i try and change it back when i press the stop button, it simply changes to a solid blue and not the nice pretty faded blue, metal kind of look that is offered as a default.

If any one can tell me how to set the back ground to the default that would be great.
17 years ago