Nick George

Ranch Hand
+ Follow
since Nov 17, 2003
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 Nick George

Hmm... Nicholas George isn't right at all... Let me just see if this is the right log in.
16 years ago
That I am using the the 3D API is (i think) irrelevant. Is there a way to tell if a KeyEvent 'came' (for lack of a better word) from a KEY_PRESSED or KEY_RELEASED?
Thanks alot for the continued responses
-Nick
17 years ago
All this WakeupOnAWTEvent nonsense is part of the lunacy involved int the java 3D API. I know how to do it with KeyListeners, but I figured I would indulge the 3D APIers, and try it their way. My question is, say a KeyEvent is fired, and I pick it up in a method. From this, I use method getKeyCode() to get what key was hit (obviously), but is there any way to divine if the KeyEvent was fired as a KEY_PRESSED or a KEY_RELEASED? By the way, if by my questions it is evident that I have a faulty understanding of how KeyEvents work, please correct me. I am eager to learn, and understand what it is i am doing.
17 years ago
Yeah, I thought of the boolean switch with pressed and released about 30 seconds after I posted my question. It works jolly well, but the constant loop must generate a fair amount of overhead, and i was hoping for a 'cleaner' solution.
BUT... allow me to use this opportunity to ask another question regarding KeyEvents. I made my WakeupOnAWTEvent set to KEY_PRESSED ored with KEY_RELEASED (I'm also WakeupOnElapsedFrames(10) for the loop, but that's besides the point). When the wakeup condition is met, it shoots to processStimulus. After I determaine that what we've got here is a KeyEvent, how do I tell if the KeyEvent was a KEY_PRESSED or a KEY_RELEASED? What i expected to be just a simple method (like getEventType or something) didn't turn up. As a result, i was forced to cheat a bit, and say that for every key pressed, there's gotta be a key released, and just say that every event flips a boolean, which i fear would screw everything up if i changed keys before releasing the first.
Long story short, after a KeyEvent is fired, how do i know what kind of KeyEvent it was? (Wouldn't it have been nice if I'd of just said that to begin with?)
Thanks,
Nick
17 years ago
many thanks...
17 years ago
I've got a JTextPane. It's a happy JTextPane. But i want it such that upon hitting the enter key whilst typing, i run method EnterPressed(). All i've found are (is?) endless Keymaps, KeyStrokes, KeyEvents, AWTEvents, all of which are just interfaces. I figured out that you can just steal the Keymap from the getKeyMap() method of the JTextPane, but attemtping to fun the setActionForStrokes forces one to try to get a keystroke from a keyevent, and KeyEvents don't have a useful constructer that just takes the int of the KeyMap you want, and it also forces you to figure out the non-sensical Action class which to use you'll have to implement about the 3rd interface, and normally i wouldn't have such a mosterous run-on but you see how near to insanity i am...
Easy answer?
P.S. i really don't mean to pester, but i've got a thread a ways down here that could really use a good anserin'... GBApplet (explains why it's not in the applet forum)
17 years ago
Is it at all possible to have the text in a JTextArea be of multiple colors? i was hoping for something of the sort
text.setColor(int startpos,int endpos,Color c);
but found no such method
17 years ago
i suppose i shoudl say the problem... java.lang.NoClassDefFoundError: BreezySwing/GBApplet
17 years ago
I know this is an applet question, but i had it posted for over a week with no response in the applets forum. don't send me back there. i've got the following code, with the following html file.

with the following html file
[CODE<html>
<head>
<TITLE>George-o-vision</Title>
</head>
<body>
<Applet code="MessengerClientApplet.class" width=512 height=512>
</applet>
</body>
</html>] [/CODE]
17 years ago
in the following code, it seems to me that a ServerSocket on port 3333 ought to be created, then it should wait for a connection, and then it should set up a Dialogue (extends Thread) with that socket. Then, it should reset itself. HOWEVER, it appears to be giving a number of Adress Already In Use Exceptions before reseting, which says to me that the port is taking some time before closing and reopening. it seems that the time it takes increases rapidly, until eventually it fails altogether to reopen. Any ideas on how to make it immediatly reopen?
i don't mean to be irritating, but i answered the question asked of me over a week ago... am i going to get any help?
17 years ago
I posted what my code lookes like... yes, it does start with public class MyApplet extends GBApplet... what of it?
17 years ago
all the classes are in the same folder, if that's what you mean. Of loading them all onto the webserver i know not. i've got an html code file and all the classes in the same folder. as i understnad it, clickin' on the html file SHOULD load the applet, but i'm getting java.lang.NoClassDefFoundError: BreezySwing/GBApplet. As i said before, this seems strange to me. it says it can't find the GBApplet in BreezySwing, but i never told it it was in BreezySwing, so clearly it does know where it is.
thanks
17 years ago
Right... i've got an inner class in my applet, generating the NoClassDefFoundError. in the topic further down on this page, someone found the solution by "jaring it up." This has little meaning to me. I don't know how to make a jar, nor how to load it into the webserver, as this person did. If these questions have been rehashed a million times, please tell me where i can find the solutions i seek.
Thanks,
nick
17 years ago
you could always cheat...
String s=(new Integer(1881)).toString();
17 years ago