How to create a Build-your-own xy using Java - java

I am looking to build a web app that allows you to pick from options like color and size, essentially custom building your own item. Similar to this: http://www.mangobikes.co.uk/bikes/custom/custom-build-your-single-speed-bike
It needs to allow me to display different pictures depending on the choices, and its supposed to have 5 dropdown menus with options. Those options also have submenus to pick colors from.
I am new to Java, and not sure where to start. Is there maybe a good how-to somewhere on the internet? And if not, any hints on how to set it all up?
Thank you

It is quite difficult to answer such a broad question (and that's why it is downvoted), but sometimes it is also difficult for beginners to know where to look.
So some pointers then:
The first thing you want: "display different pictures depending on the choices, and its supposed to have 5 dropdown menus with options" is a matter of web user interface, so you can solve it with basic javascript and HTML (see Change image source with javascript as an example). You can do that in an offline html file (you don't need java for it).
Then I assume that you need some kind of backend to send the selected values and do whatever you need with them. Without more information and assuming you want to do it with java, maybe a good alternative to prototype it could be the spark java framework.

Related

GWT: Sharing information between instances of the same module

I've read extensively about this, and I am wondering if there is a better way.
My requirement is essentially the same as this OPs.
I need to display a complex table in a new browser tab. I followed the responders advice, and loaded a new instance of the main module into the new tab. I did so like this blog post suggests. I can't simply use a dialogBox like so many people have suggested in similar questions.
I did all this without really thinking about the consequences. In particular, I now need to send a lot of information back and forth between the two instances. From what I've read, exporting to JSNI methods, or using GWT exporter are ways to do this. I've already spent soo long just getting it to be able to load certain views based on a javascript variable set when opening a new tab.
Is this a common way of addressing this problem? It seems like opening a widget in a new browser tab would be a relatively common requirement, yet the solution is getting more and more complex and cumbersome the farther I go. Is that just how it is?
Thank you
Setting a cookie in one tab affects cookies in all tabs of the same domain immediately, i.e. without reloading any of those tabs. (Just tested it in current versions of Chrome, FF and IE.)
Couldn't that be of some use?
I would give HTML 5 Messaging a try. This allows you to send JSON data between two windows. with JSNI, it should not be a big deal.
http://bear-z.com/gwt/implementing-postmessage-technology-into-gwt/
http://tutorials.jenkov.com/html5/messaging.html

Searching for Java library to build an app that interacts with data

I have a project where I should analyse data via cluster analysis. Basically the data should be visualised like this picture shows
Each dataset - for example let it be people - is one horizontal row, where vertical lines showing the attributes like sex, age, and so on.
Now if this data could be shown I also want to move the rows horizontal and also vertical a) via code and b) via drag & drop.
Do anybody know a good library for that?
Important
Target is desktop application
Expected datasets around 500
Attributes for each data set around 60
There is an app in Java/SWT already, so solutions in this direction would be preferred
The OS is Win7 so C# or similar would be a stopgap
I really like d3.js, and would prefer a similar lock & feel (but in 3D)
If somebody has recommendations for a library which helps to analyze the data, please step forward too!
Check What is the best open-source java charting library? and Libraries for pretty charts in SWT? for more info.
I did used JFreeChart with SWT (2 years ago). The code is quite horrible (you have to write tons of code), but it works and is directly renderable with SWT components (no need of SWT_AWT bridge).
EDIT
When I thought about it again, I realized, that you can use the JavaScript library through Browser widget. It's quite heavyweight solution, but it might work..
You can do this in d3 but it is a very involved process in which you need to deal with the ismoetric perspective and the rest. It shouldn't be terribly complicated but it will not be an out-of-the-box solution.

Instructions Package for Java

I want to make a help/instructions page for my Java program but I really don't want to have to go through and program all the frames and searching and such. Is there a package or program that I can just insert the data into and it will read it and create the dialog? I couldn't seem to find anything about it on Google.
It doesn't have to look like this at all but I like having the table of contents and the search at least.
alt text http://www.freeimagehosting.net/uploads/752f287397.png
Thanks
Java help system : https://javahelp.dev.java.net/
The windows help dialog you show is part of the Window Help subsystem. You could easily create a help file for that and launch it from your Java application, but it would be platform specific. If you want to implement cross-platform help functionality, you're probably going to have to implement it yourself, but you could probably do it simply by including a set of HTML resources and using an embedded lucene index to supply search functionalty.
Have you consider using a simple HTML based manual and/or website where all that information may be accessed through?
Pretty much like http://java.sun.com/javase/6/docs/ for instance where you have a main page and you can navigate the topics from there?
If that's a website ( rather than a local /doc directory ) you can have the extra benefit from having a full featured search engine index it for you.
See also: Google is the Help menu
After all, how many times do you use these help systems instead of searching the web?

How to code startup tips to be easily localized

I'm writing a new Java 6 Swing application and want to have a "Show tips at start-up" feature. I've done this before, but never with localization in mind.
In the past, my tips dialog used an XML file to hold the tips, but I'm afraid this will make things difficult when it comes time to translate these tips into different languages. I've thought about using a .properties file like with other strings in the application, but wonder if this is a maintainable approach. I would like to give the user the ability to add their own tips which will also display in the same dialog.
Is the properties approach the way to go? If I allow users to add their own tips, I'll need some way to make sure the keys (for text retrieval) are unique.
I would say the properties files is the best approach. But i would make the user a screen to add new tips, instead of letting them modify the properties files directly.
To read all the keys, you can use java.util.ResourceBundle you will find a method called getKeys
You should build a screen like this:
(source: cimco-hsm.com)

Script to take web survey for me

I had to take a surveymonkey survey today, and the format was as follows: a question was asked, then after hitting the next button, the answer was displayed as "Answer: _" along with an explanation. For kicks, I'd like to make a program that could take this survey, answering any letter, then going to the next page and reading the answer, then going back and changing the answer to the correct one, then going 2 pages ahead and repeating.
I am familiar with Java and Python, but I'm not sure how to make them be able to "know" where the button is, and how to "read" text without unnecessary image recognition.
This is just a fun project, nothing serious, but I would appreciate any ideas to get me started.
Assuming that the text was just that (text rather than images), there are a few useful tools for you:
.Net WebControl - I've scripted this before from .Net. It has the advantage of making all of the JS on the page still work. I know this isn't Java, but it is surprisingly easy to work with for this kind of task.
Selenium - It is primarily a web testing framework, but it would be easy to script it from Java to auto-submit forms.
TagSoup for Java - If the pages do not have significant javascript code that needs to run, there are many HTML parsers for Java that could potentially be used to develop a scraper.
Would it be unrealistic to make it post to the survey monkey pages? You could then do some regex's to pull "answer:__" out and look for that pattern in the original page. It would definitely be easier than trying to click things in a browser, etc. Basically, write a java app or python for that matter that does http posts to the survey pages in order and uses regex's to find the next page, etc and then use a stack to keep track of the history.
Edit if this isn't clear, let me know, I'll clarify
Edit 2: I completely forgot about HTMLUnit, my bad. It is a testing framework like suggested by jsight but specifically for Java and functions very similarly to JUnit, however, because it is designed for testing web applications, it can be used to automate interactions with other sites
You can do it using a simple image search. First screenshot the a unique part of the button and save it. This will be used as the relative reference on where you click the mouse. Then during the actual running of the application, have a screenshot of the entire screen and find a part matching the previously saved image and then let the mouse click on the appropriate location based on the button image location.

Categories