Sean Casey

Ranch Hand
+ Follow
since Dec 16, 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 Sean Casey

Hi Michael,

Thanks for your reply. I did something similar, and then I needed to simulate the holding down of the button so I used a timer to find out how long the button was held down for and incremented/decremented the spinner accordingly.
11 years ago
Hi,

In a JSlider there is a method getValueIsAdjusting() which checks to see if the slider knob is still being dragged. I can use this method to update things after the slider is no longer being dragged. Is there some way to get this behavior in a JSpinner. That is I only want to update after the value is not being incremented or decremented any more on the JSpinner. I couldn't find anything in the API that suggests there is an easy workaround, and I don't have the option of getting rid of the JSpinner. Thanks for any help.
11 years ago
Hi,

I'm using a JScrollPane that contains a number of JPanels. These JPanels are selectable, and if one is double clicked on a MouseEvent is generated and is handled by the following method:



My problem is as follows. If I have many panels in the JScrollPane, and I scroll to the bottom and select one, the one that is selected is not the one I clicked on, but instead the bottom one that is visible in the JScrollpane if I scroll all the way to the top. Is there a way to correct this? It seems that in the above method, the Point being calculated is always in the original view space, instead of being the point that is found further down the JScrollPane.

Thanks for any help.
11 years ago
Thanks for the help guys.
11 years ago
Hi,

I have a dialog that will contain 1 or 2 tables. In the case that there are 2 tables, I need them both to be viewable in the dialog. In the case of 1 table, I only want to see 1 table. I've been using setVisible on the table panels to make them appear and disappear. The problem with this is that when they're is only 1 table present, where the other table is all gray. Is there a way to alter this, so I see only the 1 table and not all the blank gray space and the table?

Thanks for any help. I'm currently using a gridlayout for this, but it's not really what I'm looking for.
11 years ago
thanks for all your help guys.
13 years ago
I have created a simple web server, that goes in a continuous loop to accept connections. This works fine. But now I need to implement a feature to be able to stop the server and the infinite loop, and I wasn't sure how to do this. So I basically want to be able to type in a command to stop the server. My problem is that when I use a BufferedReader from System.in it just blocks if there is nothing to read, and in this instance I need the loop to continue. Here's the relevant code:



How can I can I stop the server if need be?

Thanks for any help.
13 years ago
This is really a problem with IO blocking. I send the file from the client side without a problem, but on the server-side with the following code:


inFromClient is a BufferedReader. My problem is that I never come to the value of -1, after the last line of the file is sent, this loop just blocks. Anyone have any ideas how to prevent this? Thanks.
13 years ago
Hi I'm creating a simple HTTP client and Server that supports GET and PUT requests. For the client side I'm using a DataOutputStream to send the request and the file for a PUT request. I'm having trouble retrieving this on the server side though. I attempted to use a BufferedReader and I read the first line of the response, and then I open a DataInputStream and try to read the file but it's not working. Is this the wrong approach for implementing a PUT request? The GET is working great. If anyone has any ideas or could point to some resource I'd appreciate it.

Thanks for your time.
13 years ago
Thanks for all the helpful replies. The main culprit to my problem was that I didn't have the mysql driver in the tomcat/common/ directory. As soon as I put it there, and then used an ArrayList everything worked beautifully. Thanks for all the help.
14 years ago
Hi,
I'm running into a problem. I have a servlet that queries a database and then takes that resultSet and adds it as an attribute to the request and then the servlet forwards this to a jsp page. Inside the jsp I try to extract the data from the resultset, but I keep getting a NullPointerException. I know the getQuery method to get a database query works fine. I suspect there is a problem with me setting the attribute. I was told that I could set anything as an attribute. Here's the relevant code from the servlet:

and here's the relevant code from the jsp:

I keep getting a NullPointerException from the scriptlet above. Am I doing something wrong? Thanks for any help.
14 years ago
Hello,
I'm having a small problem. Here is my configuration. I'm using Windows XP. I downloaded and installed j2sdk1.4.2_03 under C:\
I then updated the path variable to point to the bin directory of the java installation. This works fine. I then installed the Tomcat 5.0 server by way of the Tomcat 5.0.exe . This worked fine and installed under C:\Program Files\Apache Software Foundation\Tomcat 5.0
Tomcat works fine and I can look at all the example jsp and servlet examples that come with Tomcat. My problem is that I can't write my own Servlets. When I import the javax.servlet. and javax.servlet.httpservlet. packages I get compilation errors siting that the packages don't exist. Do I need to update my Classpath somehow so they see the servlet and jsp packages?
Thanks for any help.
14 years ago
I'm still getting an error. Maybe I should mention this in detail:
I created a web module and under classes I have a class Tester that just contains a no-arg constructor. Outside of that directory I have a jsp called test.jsp. In the middle of the jsp I have a scriptlet like the following:

I compile the Tester class with no problems, but when I try to compile the jsp I get the following error:

Anyone know what I'm doing wrong?
Thanks for all the suggestions. How do I make sure Netbeans knows where to look for the files? I think this may be my problem. Is there a specific way to do this?
14 years ago
JSP
Hi,
I have a simple javabean class in a Player. I then have a jsp page that uses a scriptlet to create a new Player object. But every time I try to compile the jsp page (using Netbeans) I get an exception explaining that the Player class cannot be found. So my question is, do I need to adjust the classpath, or is there a special directory the javabean class needs to go in so that the jsp page can find it upon compilation?
Thanks for any help.
14 years ago
JSP