Joe Niksa

Greenhorn
+ Follow
since Feb 24, 2012
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joe Niksa

ha, yes definitely deprecated. I must have been really tired writing that comment
7 years ago
That is what I just started doing in Netbeans. Good call on the convention also. I'll see if I can tinker with it more and come up with something after some monitoring.
Thanks
7 years ago
So I have a program that I would like to run every hour. All the code I need is in Email.Run() which I execute in the main. Looking online I found a solution that I pieced together for a timer. My problem is that my program will accumulate an enormous amount of memory and CPU after about 30-45 minutes of running. I've been looking into garbage collection and haven't found much help there, besides that the system should do it all on its own. I've heard that the library Timer is a bit outdated? I'm starting here because I don't think there's a problem with how my Run() method performs. I think the main method is performing too many behind the scene "checks" of the time maybe. I don't see anything wrong with my code but can anyone provide any insight or other coding techniques to perform this every hour method?I also looked into threading but I want to know if that would be the solution or not. I would still need to include a timer in the thread and I think that maybe that's where my logic is going wrong.


Thank you
7 years ago
Thank you Michael! That is exactly how I want it to look. Thanks for the help.
7 years ago
I'm having trouble with making my JPanel look right. I am not very experienced with building GUIs yet. I've tried everything I could and now I need some major help. The JFrame is very simple looking. I got it as close as i could and then threw a screenshot in paint to modify it to how I want it to look. Can someone help me? I just want it to look very similar to the screen shot. But when the program starts, the green panel will be opaque, then after you click the button, depending on the result of the if-then statement I will write, it will either turn RED or GREEN. I know how to do that but I just need the actual layout corrected. Ignore the "fake" button i created. I was experimenting and it was the only way I could get the colored pane to show up on the bottom. I think my grid is just not formatted right.



Thanks for any help!

7 years ago
Rats! Yes I see what you are saying now. Well it's back to the lab again.
7 years ago
I see. Yes, basically my code will let someone add any file type but I have Exceptions that print out in my log that will give an error message saying that this file could not be converted. Good idea Tony, I didn't think about checking the file before it gets put into the array before my program even begins to even try to perform the commands on the files. This is what I will work on next.

On second thought. I just tested Sourav's code and this should suffice! It prevents the user from adding a file not of type .html which is what I'm looking for. And it keeps the file chooser open. I will probably have it redisplay a new file chooser afterwards like you said though. I'm sure that no one using my program will use "*" and actually try to look for an incompatible file but I want to make it error proof before I send it out for verification from my work's IT team.

Thanks everyone!
7 years ago
After adding the following code to the build.xml file... It works! I just changed "MyJarName" to the title of my class file. Yes, it does make the final JAR bigger; I went from 20KB to almost 1MB, but this is definitely what I was looking for. Thanks everyone for your input and help!



Found it here:
Source
7 years ago
Okay, thanks. I wrote it in Netbeans because that's what I've used since I started school but I hear Eclipse is great too. I will have to check it out.
7 years ago
I have a file chooser in my program that is only supposed to pull in .htm and .html files. When using the (**) trick and hitting enter, you can see all the files in the directory and select any file to import. Well, this will cause the program to crash because it's not supposed to pull in files of different type. I have exceptions to handle it, so the program won't necessarily crash but I don't want the user to even be able to do this. Is there a line of code I can include to prevent the users from viewing all the files? It's hard to search for this topic on the internet so I figured I'd post it and see if someone knows a simple way to handle this.

Screenshot included to see what I'm talking about if you have questions.


Thanks.
7 years ago
I wrote a program that parses HTML files to read some text within the files and then creates new files with filenames containing the new string information extracted from each. Anyway, after cleaning and building the project the .jar program won't run without being in a folder which includes the lib folder containing the jsoup library (jsoup is the library that parses HTML). Is there a way I can somehow include it the main .jar file so it will be more of a standalone program? I want to be able to deploy just one file.

Any help is appreciated.
Thanks
7 years ago
I am coming across an error in my code. I keep getting an "ArrayIndexOutOfBounds" error.
It prints, "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6". I understand it has something to do with the number of counters in the array because when I change the number, the error changes to the new one I put in. I'm really confused on how arrays work so any help would be greatly appreciated.


]
8 years ago