john gere

Greenhorn
+ Follow
since Mar 10, 2011
Merit badge: grant badges
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 john gere

No offence Bear Bibeault, but I a looking for a solution. Not a classroom vague 'You're on the right path' answer.
I am looking for a solution that does not involve any third party software. I am already using jQuery. There should be an answer that does not involve frontMan. However, I will keep your application in mind. Thanks for the option
I am running a nice javascript that slides image up instead of the fade in and fade out. The problem is that when 'JavaScript' is disabled in the browser the site breaks. All the images show on the site, one under the other. I tried using a javascript enabled test script. This script shows one div when javascript is enabled and hides the other. The reverse happens when javascript is disabled. Here is the actual javascript:

This is the body tag

This is the div with the images:

This is the alternative div without the image rotation


I am looking for ways to prevent my site from breaking when javascript is disabled. The funny thing is, the site where I got the script from they have achieved the feat. I just don't know how: Here is the site I got the script from:
JavaScriptSite
Ok, that does shed some light for me. Thanks.
11 years ago
Paul Clapham

That is exactly what I want to do and I'm having difficulty. What you did there:

I can't just do that cause I'll have to put it in a try {} catch {} block. While I have the opportunity I'll try to be a little clearer. The GetQuestions() method produces an ArrayList with 10 items. 2 questions and 4 answers each. So question 1, followed by 4 possible answers, then question 2 followed by 4 possible answers. The GetQuestions() method puts this into a nice arraylist. However what I want to do is, when a user clicks a button only one question shows at a time. To achieve this I intended the following, every time the user clicks the button, the method ShowQuestions() is called. This however only iterates the first 5 items of the ArrayList. Then before the method concludes the first 5 items are deleted. So when the method is called again, which will be the second button click the method then only shows the second questions which will be the next 5 items. This is what I am trying to achieve and not to sure how to get it. Hope this clears things up. Having said that, what should I do?
11 years ago
I have a method that generates an ArrayList of questions. Here is the code:

When a user performs a mouse click action I want to call a method that uses this method to produce an array list of questions, but only once. It makes no sense every time the user clicks, the actioned performed involves creating a new instance of the above method to get an arraylist. The instance must only be created once. A singleton pattern is usually used to create something once, but I am not sure how to do this. How do I achieve what I am looking for?
11 years ago
Thanks a million. WoW! I never thought I would get such an easy and simple solution. Was about to brace myself for a few days reading on using Ant with OneJar. Thanks again.! Now it's off to learning how to sign my jars for copyright purposes.
11 years ago
Are you suggesting that I have to clean and build my project, then save this script to a build.xml and run 'ant' from the command line? That I have not done. I assumed I had to copy and paste to either the build.xml or the build-impl.xml. I actually tried both and it failed. So now I guess I have to run a 'clean and build' in netbeans, then put this script in a build xml file in the dist folder and then run it from the command line using ant. Given that ant looks for a build file, I just have to type in ant.

Is that about correct??
11 years ago
When using Netbeans 7.0.1, deploying a gui desktop application is as simple as hitting the 'hammer and broom' icon, which says 'clean and build main project'. However this does not produce a single jar file. Instead you get a lib folder as well where various dependency jar files are lodged. I wish to deploy a single jar file. So no lib folder. Just a single executable jar file. How can I do this??

I already tried the solution found at this site:
http://192.9.162.55/developer/technicalArticles/java_warehouse/single_jar/

But it does not work. Any ideas?
11 years ago
I am using Netbeans 7.0.1. I wish to change the little javacup icon to the top left of the gui Desktop application. I did some searching and found a contribution that wishes to replace some code:


with this code



The favicon.ico being my file, the icon I wish to display on the title bar of the desktop gui. None of these solutions work. Any other ideas?
11 years ago
I understand the 4 iterations and breaking the loop. But what would the action listener store? Use it to keep the track of the 'condition' of the loop?
11 years ago
In general, how do you iterate an arraylist say of 12 items, but only 4 at a time using a jbutton. In other words, when the gui launches, the first 4 items show, then every time the button is clicked, the next four items show and so on until the end of the Array List? How is this done? All I know is that, it has something to do with the actionperformed method or action listener.
11 years ago
When using the HttpServlet you keep state using sessions, "HttpSession". However when building a desktop application or building a GUI application, what do you use? Let say to keep track of an ArrayList? Everytime a button is clicked, the ArrayList decrements and something new shows on the Window. How do I do that??
11 years ago
I have solved the problem and I wish to thank everyone's input. Here is the code for the modified build.xml. All I did was place the WEB-INF(along with its usual contents, web.xml, classes folder etc) into the web folder and used the copy function to dump it into the root package folder. This is what it looks like:

Of course since the "src" folder has all my classes I have to copy everything from "compile" destination folder to the "WEB-INF/classes" folder.
11 years ago