Noah Carroll

Ranch Hand
+ Follow
since Sep 20, 2000
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 Noah Carroll

I use RealJ which is free online. It is basically that a fancy notepad that highlights the syntax and allows you to run your applications with one click of the mouse. It is simple to use.
I believe that the .getClickCount() method that you are trying to use is used to determine whether or not a person did a single or double click. In your case you might try adding some code to your mouseClicke(MouseEvent e) method that you have left empty. You could set up a seperate integer and every time that method is entered you could just add one to the integer. The method is entered every time the mouse is pressed and released. In other words, as soon as you let go, it enters that method, and in your program it does nothing inside.
[ March 31, 2008: Message edited by: Noah Carroll ]
19 years ago
An obfuscating tool will go through your source file and it will rename every variable that you use to something very unreadable and difficult to follow. For example, if you have a variable named currentCount, the obfuscator may rename it to something like hix83md, making it hard to understand. You could not tell by the variable what its use was, you would have to completely read through the code and try to understand how it had been used. This is good because it discourages decompiling because it is incredibly time consuming to rename all of the variables.
------------------
I hope its helps, feel free to email me noahcarroll@juno.com
22 years ago
Are you sure you have the latest Java Runtime Environment installed.
22 years ago
If you want to get an accurate time limit, you can use the system clock. As the program begins you should run the command System.currentTimeMillis(); and store the value returned. Then in a seperate thread you can run a loop that will call run the same command again getting a new time. Then it will test to see if the difference between the two is equal to the length of time that you want to have passed (in milliseconds). Then if not it will pause for a second or so and then repeat. This is very accurate use for time limits.
<PRE>
long startTime = System.currentTimeMillis();

//seperate thread
long timeLimit = 60*1000; //60 seconds
long testTime = System.currentTimeMillis();
while((testTime - startTime) < timeLimit) {
Thread.sleep(1000);
testTime = System.currentTimeMillis();
}
//send information to main thread to stop execution
</pre>

------------------
I hope its helps, feel free to email me noahcarroll@juno.com
22 years ago
Barry, here is the code that I used a while back in one of my applications. It is concise and works great. Just use the handler for your mousemotion.
<PRE>
class MouseMotionHandler extends MouseMotionAdapter {
public void mouseDragged(MouseEvent e) {
window.setLocation(
window.getLocationOnScreen().x - (p.x - e.getX()),
window.getLocationOnScreen().y - (p.y - e.getY()));
}
}
</PRE>
22 years ago
Looking at the code will help, but the first thing I thought of was how operating systems handle file sharing. If you have a file open in one program you cannot open it in another. The servlet that created the file may not have released it back to the operating system, therefore the operating system will not allow anything else access to it. So just waiting does help due to Java's garbage collection process.
22 years ago
The best way to do it is to implement a mouse motion listener to either the entire window or a component within the window. Then when the user clicks and drags on that part you can have the entire window move to the new location. It is quite simple code. I have done it before, but it is on a different comp. I will post it tonight unless someone else does.
------------------
I hope its helps, feel free to email me noahcarroll@juno.com
22 years ago
can you post the code?
22 years ago

This is my code. The URL is created here because 'url' is a string previous to this code. I know this does not work on images becuase of the way they are made, but I can't think of how else to do it. Thanks
23 years ago
I need to know how to download images from a web site to my computer using i/o (or a better way if one is known). Using the available input and output streams my pictures end up, well, not like they used to be. Any help is much appreciated.
23 years ago
One way to do it is by calling the method that will return the screen size with current monitor settings. The method is in the window class so any frames or windows can use it. You can access from your main frame by
Dimension wndSize = mainFrame.getToolkit().getScreenSize();
The method getToolkit() returns a Toolkit object that has many useful methods in it, getScreenSize() being one of them. getScreenSize returns a Dimension object, so to center a 400 X 400 frame do this
mainFrame.setBounds(wndSize.width/2-200, wndSize.height/2-200, 400, 400);
------------------
I hope its helps, feel free to email me noahcarroll@juno.com
[This message has been edited by Noah Carroll (edited January 24, 2001).]
23 years ago
could you post the html that you are using to run the applet? it is too hard to guess.
23 years ago
Thanks for all of your help. I am dynamically changing the contents of my list. The problem is that every time I alter the contents I completely change them, not just one or two things. I discovered it is easier to not use the ListModel like I had been and I have it work great.
23 years ago
Thank you for trying to help, but I did that from the start. When I make the window so that it doesn't show twenty items, it uses scrollbars to show the remaining twenty. Even if there is less than twenty items, it still makes the scroll bars so that they can fit twenty items.
The first time the JList is display it shows twenty items. Each time after that it shows less than that or twenty but never more. It must have something to do with the initial size.
[This message has been edited by Noah Carroll (edited January 09, 2001).]
23 years ago