apchar boiir

Greenhorn
+ Follow
since Sep 07, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 apchar boiir

Start with the Java Tutorial. It's good, free, & downloadable from oracle. After that, I'm partial to the Core Java I & II books. They're very comprehensive. Their only downside is that the print in the latest versions is so small you need to read it with a magnifying glass.
12 years ago
I've tried both and settled on netbeans. Eclipse has become just too complicated. Eclipse is trying to be all things to everyone and has gotten too cumbersome for me. And while neither is blindingly fast, netbeans seems a little bit faster than eclipse. But I made that decision more than 2 years ago. I'm sure both have changed.
yeah yeah, counters are usually integers (int)
12 years ago
You need another variable: a counter that keeps track of how many numbers have been entered. Remember that any variable can be added to itself. For instance:

double x = 4;
x = x + 1;

after these lines are executed, x will be 5
12 years ago

Pat Farrell wrote:I'm a bit surprised that no one gave the trivial and easiest answer: don't store your password in the code. Period.

If you store the password in code that a bad guy(tm) has access to, then they can get access to your password. This is true for source code, byte code, object code, etc.

If you are serious about security, you can't have direct JDBC access from code running on the client, because you can't trust the client computer. To handle this properly, you have the user login, and you return a session nonce (in a cookie, or whatever). Your client side code then passes back the session nonce to the server-side, and the server-side validates it and calls JDBC.



So is this what a servlet would do?
Should I look for a webhost that supports tomcat if this is the plan?
It's been a while since I last tried it but yes, they do.
So the server application would examine & validate the data before writing it to the database? Makes sense.
Is there a buzzword for this sort of thing that I can look up & learn more?
What should I look for in a webhost to make sure they'd allow me to run such applications? I'd think most would be leery of anything alien running on their servers.
I did. The corrected code is:
12 years ago
I have an applet that remotely accesses a password protected MySQL database. It both reads from & writes to the database.
Java decompilers are easy to find. Anyone could decompile my applet, look for
DriverManager.getConnection(..., "userName", "password");
and they'd have the password. Anyone feeling malicious could wreak bloody havoc on my database. But I just can't see anyway around it and most books don't even talk about security.
What can be done to protect that password?
Consider the bit of code below. It's a much simplified version of my real app.
In jPanel1 is a single label. In jPanel2 is a single button.
The button in jPanel2 is supposed to wipe clear (with removeAll()) jPanel1 and add a new label in place of the old one. What actually happens is that after the first button press, jPanel1 is indeed cleared by the removeAll() method but the new label can't be added (or rather it can be added but won't show.) I can hard code the removal & addition back and forth all day & it works fine. It's just when I use a swing component like JButton or JComboBox that it doesn't work. Why?? Is this a thread thing? (I know I can just change the text of the label but the real app is much more complicated.)

12 years ago
Turns out it was a panel size issue. I just assumed imagePanel would automatically fill the frame. It doesn't. When I set it to the size of the image it works fine.
12 years ago

Rob Spoor wrote:The problem appears to be in the layout manager. If I uncomment the call to "getContentPane().setLayout(layout);" I get the image.

I haven't used GroupLayout myself but its Javadoc page seems to require you to add the components through the layout manager, not directly through the content pane.



Yikes! But netbeans doesn't give us access to the layout manager! It's in the protected code block. You can unlock the code block but that breaks the GUI builder. Surely I'm not the only person to run into this. Gadzillions of people use Netbeans day & night (or at least a few hundred for a few hours a day).
12 years ago
This little bit of code is almost straight out of "Core Java2" except it's Netbeanified. I know it gets the image because it prints the right width. But the frame is blank. Where did I go wrong?
12 years ago
Thank you thank you thank you!!
19 years ago
I'm writing applets. I'm compiling them with j2sdk1.4.2_04.
I ran htmlconverter on the html file that holds the applet.
It set the required java version numbers to 1.4.2_04.
I'm testing it on another machine that has the j2re1.4.2_05 plugin.
When I try to test it I get the message that I need the 1.4.2_04
plugin. But I already have the next version (1.4.2_05.) Aren't plugins
downward compatable? I cant expect my users to install different versions
of the plugins just for my site.
Thanks,
Apchar.
19 years ago