Jerry Olsson

Greenhorn
+ Follow
since Mar 24, 2004
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 Jerry Olsson

Hi,

I'm been developing quite alot for cell phones lately and have realised I'm not really take cpu and memory usage into consideration when I'm writing my code
I'm trying to improve my skills on this area and I have some questions.

What would be more efficient of the following:



I guess the difference is minimal but it made me wonder
Anyone have any idea about this one?
16 years ago
Start your program with getting the screen size (use your Displayable) then resize everything according to the screen size.
myDisplay.getWidth() myDisplay.getHeight()
16 years ago
Today I passed the exam! not the best score but hey I passed!

A big thanks to Javaranch for being my favourite place to read up on java. Another big thanks to Bert and Kathy for their excellent book on SCJP 1.4. Great book to read with a couple of good laughs!
16 years ago
You can round up the last hour. Round up 0.3 to 1 with Math.ceil();

charge=2+(0.5*(Math.ceil(houre-3)));
16 years ago
Hello

I'm looking for a component that will update itself with data from an XML file. JBuilder has a similiar component (a ComboBox) which updates itself from a DB. You connect the component to a SQL query and it will update on focus and so on. I want the same thing but instead of the SQL query I want to connect it to an XML file. Have anyone seen such a component?
Wouldn't rs.isAfterLast(); return true if the ResultSet is empty?
Hello!

Is there any way to access an object from the droptarget before the actual drop? I want to know what kind of object I've dragged over the droptarget so I can set the colors and stuff accordingly.
17 years ago
I'm also in doubt of which book to buy but I'm leaning towards K&B's book. For the new stuff in 5.0 I'm gonna borrow "Professional Java, JDK 5 Edition" from a friend.
Every one of the "boxes" we move around holds quite a bit of data and also works as droptargets. There are lines between the boxes that would have to be redrawn whenever a box is moved and when in motion.
We found out today that it actually didn't have to be movable. When we want to drag a box to another (to a droptarget) we can just change the mouse pointer to indicate a drag being executed. But I still can't stop thinking of the painting...
17 years ago
Hello!
I'm having some problems with paintings. I have a painting area which extends JPanel. On this area I add different objects that also extends JPanel. I have overridden the paintComponent in both classes and so far everything is working fine. I can move around the added object without problems.
When I try to write a line from (0,0) to the added object while I move it around it wont repaint the entire painting area. It only repaints the rectangles where the object was moved from and to. How can I force the painting area to repaint the entire area instead of just the one's that changed?
17 years ago
actually came to think of one thing I made reusable that I might actually use. I wrote a Database Handler to connect to a MSSQL database. I've only used it once though.
hello all,
Our teacher always told us to write code that could be reused in another application. 99% of the code I write has absolutely nothing to do with eachother. Meaning I can't reuse any code at all. Do you experienced programmers reuse alot of code? Or should I give up on writing reusable code? It takes a bit more time to make it reusable but is it worth it?
Hello!
A while ago me and my friend set up a webserver at my place. It was running win2k with apache and tomcat. We had some problems getting it to serve pages right from outside my LAN. After alot of searching and editing in the config files we finally got it working. I wonder if there is any kind of interface you can use to do these settings? We were/are beginners in this area and searching and editing stuff you have no clue about was hard enough to kill our project.
18 years ago
I used puma.kicks-ass.org first but then it didn't work. tried several other things that didn't work. Using the internal ip instead worked but not on everything. I realized today that I didn't replace puma.kicks-ass.org everywhere in server.xml and when I did that it worked fine
18 years ago
Hello, I made a search for my problem but couldn't find anything so I decided to post.
I'm running Apache and Tomcat on a win2k machine which are placed behind a DI-604 router.
I've connected the apache and the tomcat using a JK. The problem is that I'm not sure what my host should be? I have a dyndns that points at my ip from my isp. when I access plain html (that is placed in tomcats directories) it works fine but as soon as I access a .jsp it doesn't work and I get the following errormessage:
"No Host matches server name puma.kicks-ass.org
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request."
I have set the internal ip to the server as the host in server.xml and it works if I access the jsp with the local ip (http://192.168.0.158/examples/jsp/dates/date.jsp). if I access with (http://puma.kicks-ass.org/examples/jsp/dates/date.jsp)
Summary:
I can access plain html on the tomcat with my dyndns but not .jsp.
I can access both plain html and .jsp using the internal ip.
I hope someone can help me here. I'm going crazy over here

adding the essential parts of server.xml
18 years ago