Win a copy of Spark in Action this week in the Open Source Projects forum!

Erick Smith

Greenhorn
+ Follow
since Apr 09, 2000
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 Erick Smith

I've been having a terrible time with serializing Vectors. I can't seem to get them to update consistently.
Here's my scenario: I send a vector from a client applet to a server application via an objectstream on a socket. I send a vector every couple of seconds that consists of a list of integer arrays (int[]). Now the problem is, that the information contained in the arrays doesn't seem to get serialized unless the actual structure of the Vector is changed (i.e. add or remove an element). What I want is to be able to change some of the values of the integer arrays, serialize the vector that contains all the arrays, and update the whole list on the server side, but the values seem to stay the same even when the client has changed the data! When the vector structure changes, poof, all the new values are correct on the server side, but only that once. No values will change until the structure changes again.
Can anyone help me to figure out how to properly serialize vectors so the internal data gets updated? I've tried everything I can think of, but nothing seems to work.
19 years ago
I could really use some help from anyone.
I have determined that the error is fired anytime the JCombobox has the focus and the shift key is pressed.
This also happens with my other JComboBox in the same JInternalFrame anytime it has the focus and the shift key is pressed.
I've tried preventing the JComboBox from getting the focus, but I've had no luck.
All I want is to know how to keep the error from happening, I don't need any keyboard events at all going to either of the JComboBoxes.
Does anyone know how to prevent modifier keys from doing this?
19 years ago
I have an applet that makes use of some animated gifs. I do this in order to show animations without adding the JMM (Java MultiMedia Pack). If anyone can suggest another efficient way to display animations I'm open for that as well.
My problem: Gif animations don't work once they're serialized!
I serialize the gif's as Image Icons, but once transmitted, only the first frame shows. If I load the gif into an imageicon using the html method all is well.
Can anyone help here? I'd like to be able to serialize all the info being sent to the applet.

Thanks,
Erick
19 years ago
Is there a way to tell if an event was triggered by a user's input, rather than programmatically.
Specifically I'm referring to a JComboBox and a JList.
Thanks
19 years ago
I have a JComboBox that opens a JInternalFrame when any selection is made.
In the same panel I have a screen that changes a graphic when the user presser the mousebutton with the shift key held down.
Since I've migrated from v1.2.2 to 1.3.0 I have a runtime error that I can't seem to get rid of.
Here's the error:java.lang.NullPointerException
at javax.swing.JComboBox$DefaultKeySelectionManager.selectionForKey(Unknown Source)
at javax.swing.JComboBox.selectWithKeyChar(Unknown Source)
at javax.swing.plaf.basic.BasicComboBoxUI$KeyHandler.keyPressed(Unknown Source)
at java.awt.AWTEventMulticaster.keyPressed(Unknown Source)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.processKeyEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Now the problem seems to be that when the JComboBox is selected, it grabs the focus. Then when the user hits the shift key, the JComboBox tries to process the shift key.
I've tried setRequestFocusEnabled(false) in order to keep the JComboBox from grabbing the focus, but this doesn't seem to help.
Can anyone help with how to keep the JComboBox from pushing this error?
Thanks much,
Erick
20 years ago
I have the HTML converter. This isn't the problem. There is no problem with the code itself (or so it seems), instead it seems that newer plugins may not be fully backward compatible.
20 years ago
If anyone can suggest a fix to my problem, I'd greatly appreciate it.
I am writing a applet that communicates with a server via sockets. Currently I'm having a problem with the applet not loading and executing properly in various browsers. The problem here, I'm pretty sure is the JRE versions on the remote machins.
Currently I'm developing using jdk 1.2.2
Using the java console, the applet works fine in IE on the machine that reports the JRE as 1.2.2 with plugin version 1.2.2.p001
The applet fails in IE on a machine that reports the JRE as 1.3.0 Java hotspot client with plugin version 1.3.0-C. (failure is incompatible ImageIcon versions)
Also, the applet seems to run most of the time if the JRE is switched to 1.2.2 Classis, while keeping the plugin as 1.3.0-C.
The applet also fails on another machine with JRE version 1.2.2 with plugin version 1.2.2.p005. (the applit fails to open some JInternalFrames)
I am concerned that the applet doesn't function even on machines with Newer JRE and Plugins. Any suggestions on what to do? This applet is intended to be run over the internet, so I have limited control over the client machines.
Thanks much,
Erick
20 years ago
If anyone can suggest a fix to my problem, I'd greatly appreciate it.
I am writing a applet that communicates with a server via sockets. Currently I'm having a problem with the applet not loading and executing properly in various browsers. The problem here, I'm pretty sure is the JRE versions on the remote machins.
Currently I'm developing using jdk 1.2.2
Using the java console, the applet works fine in IE on the machine that reports the JRE as 1.2.2 with plugin version 1.2.2.p001
The applet fails in IE on a machine that reports the JRE as 1.3.0 Java hotspot client with plugin version 1.3.0-C. (failure is incompatible ImageIcon versions)
Also, the applet seems to run most of the time if the JRE is switched to 1.2.2 Classis, while keeping the plugin as 1.3.0-C.
The applet also fails on another machine with JRE version 1.2.2 with plugin version 1.2.2.p005. (the applit fails to open some JInternalFrames)
I am concerned that the applet doesn't function even on machines with Newer JRE and Plugins. Any suggestions on what to do? This applet is intended to be run over the internet, so I have limited control over the client machines.
Thanks much,
Erick
20 years ago
I have had similar problems. Now I'm fairly new to java, but what fixed it for me was careful attention to the variables I used. For some reason, there seemed to be problems if I used the same variable for a graphic, but changed the contents of the variable and made several buttons. to fix this I simply made sure to create new instances of the variable for each time I made a button.
Maybe this is basic to everyone, but I was having the kinds of problems you describe. Graphics on wrong buttons, or incomplete graphics, or jumbled graphics.
20 years ago
If anyone can suggest a fix to my problem, I'd greatly appreciate it.
I am writing a applet that communicates with a server via sockets. Currently I'm having a problem with the applet not loading and executing properly in various browsers. The problem here, I'm pretty sure is the JRE versions on the remote machins.
Currently I'm developing using jdk 1.2.2
Using the java console, the applet works fine in IE on the machine that reports the JRE as 1.2.2 with plugin version 1.2.2.p001
The applet fails in IE on a machine that reports the JRE as 1.3.0 Java hotspot client with plugin version 1.3.0-C. (failure is incompatible ImageIcon versions)
Also, the applet seems to run most of the time if the JRE is switched to 1.2.2 Classis, while keeping the plugin as 1.3.0-C.
The applet also fails on another machine with JRE version 1.2.2 with plugin version 1.2.2.p005. (the applit fails to open some JInternalFrames)
I am concerned that the applet doesn't function even on machines with Newer JRE and Plugins. Any suggestions on what to do? This applet is intended to be run over the internet, so I have limited control over the client machines.
Thanks much,
Erick
20 years ago
Ok, I figured this out. I just needed to enable 'show java console' in the java plugin settings, not the IE or netscape settings.
20 years ago
I am trying to debug an applet and am having a problem with the java console.
If I run the applet (in appletviewer or IE) on my machine on the network, the java console sends the appropriate info including system.out lines that I have included in the applet.
However, if I run the applet on any other machine in my network, the java console does nothing and doesn't pop up automatically in IE like it does on my machine.
The applet communicates with a server program through sockets, and that program is on a seperate machine from any of these tests.
Might my java console be different because it is the development machine, and I've installed the JDK there?
How can i do debugging from other machines (ie, how can I get the verbose java console) that don't have the JDK/JDSDK installed?
20 years ago
I am writing a swing Applet, and I get mouse cursur artifacts left on the screen anytime the mouse buttons are pressed.
Basically, it seems like Swing doesn't always repaint the little square that the mouse cursur occupies.
has anyone else seen this, and does anyone know how to fix it?

Thanks,
Erick
20 years ago
I'm writing a client/server system in which I transmit a lot of objects back and forth. I'd like to implement the DeflaterStream/InflaterStream in order to make this process more efficient. I have gotten this to work, but only once during an execution. Here's what I have:
DeflaterOutputStream defOut = new DeflaterOutputStream(objectSocket.getOutputStream());
ObjectOutputStream objOut = new ObjectOutputStream(defOut);

I can send an object through this by using:
objOut.writeObject(myObject);
objOut.flush();
defOut.finish();
I have not been able to get this to work without the finish line, and that seems to close the Deflater stream, which then causes me to have to restart both streams. Am I doing something wrong?
It seems like I should be able to stop sending an object while leaving the DeflaterStream open so that I can sen another object through at a later time. Could anyone explain how to accomplish this?
Thanks
OK, I would like to improve my applet so that it accesses a Server program via a client/server system.
I am thinking I should just write my own Server program and just open a socket to it on some port. I have two questions, however:
1) How do I set the proper permissions on my Host machine so the applet can connect to the Server program from elswhere on the Internet?
2) What would be the pro's and con's of using a Applet/Servet combo to do this? Or does Applet/Servlet not work like Client/Server?
Thanks,
Erick
PS - This board has been far more helpful to mee than any boards on the Sun site! Thanks much for everyone's previous help.
20 years ago