I'm building an app that lets a user select a folder, the app then collects all of the images in that folder and allows the user to add captions and descriptions. Essentially an interface that generates XML that drives a Flash photo gallery.
I'm now looking at various ways to provide some way for the user to rearrange those images in a different order. I'm leaning toward some window of thumbs that allow drag and drop functionality, but...
1 - I'm a total Java noob so this is beyond my skill set today. Though I am willing to tackle it if...
2 - Is this a good GUI user friendly approach? Are there other methods that will provide a better user experience?
Essentially, I'm looking for ideas, a kind of what have you seen and used that is elegant and easy to use that provides this functionality.
If there are code examples that can be added, that would be perfect...
Consider
using a JList which is built to easily display images and would allow drag & drop functionality with a minimum of coding.
For creating the XML, perhaps try JAXB, although I would consider this to be a bit more than "basic" Java.
Related
I am planning to implement a screen arrangement view for a desktop Java application. By screen arrangement view, I mean a view that allows to arrange several rectangles around a central rectangle, so that no gaps are allowed, much like the screen arrangement interface in eg macOS or Windows works:
The user would be able to drag the rectangles (except the central one) around and place them somewhere adjacent to another rectangle (that is connected to another rectangle that is connected to another rectangle .... that is connected to the central rectangle). The rectangles would automatically move to a correct spot if dropped at an incorrect spot.
I have experience in Java (Android), but little knowledge of User Interface design on desktop Java. I am using Swing for all UI I have already in my application.
I have done some research but could not find any similar implementation or question on SO.
However, I do not want to reinvent the wheel, so before I start implementing from scratch, I have these questions:
What search terms could I use for further research?
Are there any built-in components I could use as a base?
Is there maybe an open-source component I could use?
Does anyone know an implementation of such a control in any language that I could use as a reference?
How would you implement such a control?
Any help is highly appreciated!
1.What search terms could I use for further research?
One of the search term you can use is drag and drop (and that is what you plan to do).
2.Are there any built-in components I could use as a base?
Java has built in classes for drag and drop. Take a look here: Drag and Drop Turotial
3.Is there maybe an open-source component I could use?
I am sure there are quite a few if you try Googling it. But, personally I don't think you need an open source component to perform your required task. Java Swing already has pretty good classes available which is easy to use and more than enough to handle what you want.
5.How would you implement such a control?
Other than using the DnD from Java, a similar feature can be implemented using custom painting + various listeners such as Mouse motion listener. This way, you set what ever rules you want over the components that is being dragged / clicked / mouse-over. For example.
Back in my, ahem, Visual Basic programming days, I remember it was very easy to create a multi-form program.
In the gui designer I could simply create as many forms as I wanted and then load them in my program where needed.
I'm having a very difficult time doing this in Java.
I started out using the Java FX Scene Builder but soon discovered there doesn't seem to be good MDI support. So, back to Swing. But, again, I don't see a simple way to design a multi form application.
I read somewhere that JDesktopPane was the way to go as it will allow you to have different internal frames, but there is no way, that I can see, to design multiple frames in the NetBeans gui designer.
You would think that you could hide an internal frame in the designer so you can layout another frame. While I can add multiple frames to my JDesktopPane, they all overlap each other making it impossible to design multiple frames.
Are there any tools available to do what I'm trying to do, or do I just need to bite the bullet and code the guis without the help of a designer?
In brief, I just want to create a simple application that displays three or four options on a home screen
Enter new customer
Search for existing customer
Quick estimate
And depending on which the user selects, opens the appropriate form. It would seem that this would be a basic requirement for almost any program and I don't understand why it seems like actually creating an application with multiple windows/forms was never thought of when developing the design/development tools. Thoughts? Suggestions?
If you're really keen on using the multi document interface (MDI) of the JDesktopPane, create each form in it's own class form. Don't drag them to the desktop. This will allow you to isolate them.
(You can double click a internal frame and it should enter "isolation" mode, basically making it the only thing you can see)
However, unless the windows are sharing information (ie you want to see the information in one window to change the information in another), I'd avoid it.
A better solution might be to use a CardLayout which will allow you to switch between each form as you need.
Again, I'd start by building your forms from something like a JPanel, individually, and when you're ready, add them to your main form.
I always encourage people who are coming into Swing anew to hand code their forms, it will give you a great appreciation for how to design forms and the power of the layout managers.
I am writing my dissertation this year in software engineering. I have a cool project in mind but wanted to ask if this was even possible first before I mention it to my tutor. If it is possible then it would be good if someone could point me in the right direction in achieving my goals.
My ideas is this. I want to make a Zombie survival game, generic and boring I know, but I want players to be able to run around in their own hometowns as if a zombie outbreak actually happened, the easiest way to do this would be to use the Google Maps API (I think) so maps are automatically created depending on a users home location.
And added feature would be to implement transport systems using local train stations so users can actually move to their friends areas in realtime on a multi-player platform.
So from what information I know already I would need these tutorials/resources.
The ability to import real time google maps into a Java environment
The ability to see where roads occur and where areas that can be walked on occur, maybe using the colour green as a basis for fields etc.. This is to ensure users can only walk within defined areas
The ability to generate surroundings (such as houses and fences) next to roads and walkable areas rather than have the user running around on a flat 3D environment
I already have some knowledge on creating 3D environments as it is using the JWJGL library. Each of the points stated above are dependent on the previous bulleted point. Any feedback or constructive criticism is greatly appreciated. Even just a "What the hell are you even talking about" would be helpful also.
Glad to see your replies.
It might be possible using the Google Earth API: https://developers.google.com/earth/
You would have to get a web view of some kind, basically integrating a JavaScript application into your Java application. I would be cognizant of the terms of service though.
How do I create a J2ME app for cellphones with a GUI similar to the menus you see in Java games? I've tried MIDlets with Netbeans but they only show you one GUI element at a time. (textbox, choice, login, etc)
And which Java IDE would you typically design these GUIs in? Netbeans or Eclipse? and is IntelliJ IDEA usable for this aswell?
Do I have to write/get a library that draws GUI controls to screen via bitmap functions .. and keeps track of the keys pressed for focus?
Try to use LWUIT - nice UI toolkit for j2me:
https://lwuit.dev.java.net/
http://lwuit.blogspot.com/
You can also use minime: http://code.google.com/p/minime/
It's an open source GUI library for j2me. miniME works on canvas level (lowest level in j2me) to draw every control so your UI will look exactly the same whatever the handset it'll be running on. Other advantage are:
- miniME uses its own event loop to manage user controlled event (botton pressed, softbar, ..), so you Application will "behave" the same whatever the handset.
- miniME support the concept of Views and stack of view, in order to make navigation between different view/screens very easy.
Here is an example: A View is what you have on the screen at a given moment (for example the main menu screen), then to go to a sub menu, you create a new view, and by calling a simple API, you push it in the stack of Views. The previous view (the main menu) is still existing, but inactive. When the sub menu view complete his work (for example, user press back, or do a selection), you can just go back to the previous view by calling a pop api.
Your question is a bit vague to give a specific aswer, but you might want to check out LWUIT or Polish, you can develop both with either Eclipse or Netbeans.
As far as designing GUIs go, neither IDE will help from a visual perspective. J2ME UI development is all done in code, beyond creating any initial graphics in a proper graphics editor you don't get to see your output until you test.
Read up on the LCDUI package documentation which explains how the UI classes work and the differences between the 'High-level' and 'low-level' APIs.
I can't comment on which IDE to use - but I do know that to create custom UI (like the ones you see in J2ME games), you have to explicitly draw the GUI controls.
Beware that you may need to customize the GUI depending on the target phones. You have to cater for different screen sizes, key pad configurations, default theme etc. This would probably mean that you need different builds for things like different screen sizes which would drive up your Java Verified certification costs (if you need it).
You may be able to find a set of nice looking UI controls that you can buy online and use (try J2ME Polish). The easy way out of course, is to use default J2ME controls :)
Links to many j2me GUI libraries: link1, link2
I know that kuix is not bad and free - watch demo.
But i prefer to make my own gui elements - this is much more flexible (but takes some time).
As for IDE - you may want to make some kind of gui-editor tool, construct interface in it, save result to some file, and read it from your app.
It's way too cumbersome to write your own GUI, especially since there are so many available these days. If you're familiar with desktop development in VB.Net and C#, you might find "J2ME GUI" easy to use. You can download it from http://www.garcer.com/. It has a similar feel and makes it easy to learn. This is the kind of GUI that I expected to come standard with MIDP2 when I started mobile development. Would have solved a lot of issues.
If you are familiar with web stuffs then you can use KUIX (kalmeo.org/home/index) framework having xml and css supports. In place of It you can use also Polish framework (www.j2mepolish.org) it's also uses the xml in easy way rather than kalmeo kuix framework.
I'm writing a time management application and I have an idea for presenting timelines and todo items in 3D. Visually, I imagine this as looking down a corridor or highway in 3D, with upcoming deadlines and tasks represented as signposts - more important items are larger and upcoming deadlines are nearer.
I want to do this in Java, however I have no idea how to begin. For example, I would like to be able to render text and 2D graphics (dates, calendars etc) on the floor/walls of the corridoor, as well as on task items. The tasks themselves could be simple blocks. However examples of 3D code I have seen all look to operate on a very low level, and what I can't figure out are the appropriate co-ordinates to be using, or how the user would be able to interact with the view by selecting items with the mouse (for example clicking an expand or info button to get/edit task properties with the usual swing components).
Is there any higher level API I could be using, or example code that does this sort of thing? Any other ideas for how best to approach this problem?
edit: removed Java3D requirement - I just need to do this in Java.
To be perfectly honest, most "clever" user interfaces are ineffective for a number of reasons:
They favor complexity (for the sake of coolness) over simplicity and usability.
They are likely to be totally unfamiliar to the user.
You have to implement them yourself without some library having done the hard work for you.
I think the interface you describe runs the risk of falling into this trap. What's wrong with the current interface? Won't it be really hard to get an overview due to foreground stuff getting in the way? Now of course you could take it a step further and zoom out/rotate to get an overview but that complicates things.
Having said all that, if you can make it easy to use and really slick, then it can make an application. Users will have a lower tolerance for failure in "fancy" UIs, so perhaps this isn't the best first 3D project.
I do think there is a need for more examples geared towards visualisation rather than games.
To be honest, having tried both, if you use JOGL instead you'll find there's tonnes of OpenGL examples to copy that sort of thing from, and you won't have to code around the limits of the scene graph Java3D gives you. I tried Java3D a couple of years ago in a simple wireframe viewer, and it was such a pain to get the camera control right and the rendering anywhere near OK that I gave up on it.
I've found Pro Java 6 3D Game Development to contain very good code examples.
Here's a code example of 3D text, from NeHe Productions!, check the "DOWNLOAD Java Code" and "DOWNLOAD JoGL Code" at the end of the example.
On a side-note, I was very impressed with LWJGL which makes you write in a very similar way to straight-forward OpenGL.