I've been trying to create a GUI using netbeans, that includes a dialog similar to Netbean's own "property dialog" that appears when designing. ie. a dialog that contains a table that can be expanded by tree nodes. Something like the dialog on this page, http://platform.netbeans.org/tutorials/nbm-property-editors.html
As far as I can understand, the page I linked to describes a custom editor I can set up for use within netbeans while designing - I'm just looking for a way to doing something similar for my actual application I'm writing. Is there an easy way to do this?
I came across this and have tried it but it doesn't quite work in the same way as the standard Netbeans dialog. weblogs.java.net/blog/timboudreau/archive/2008/06/egads_an_actual.html
Any tips greatly appreciated.
This will sound flip... but I am being serious.
The easiest way to do this is to write your app using the NetBeans RCP platform.
You may want to look at the Swing Application Framework, too.
There are a couple SAF samples integrated into NetBeans... You can read about them here: http://netbeans.org/kb/docs/java/gui-saf.html
I could not find a property editor dialog sample, though.
I found a couple other pointers, using this query: http://www.google.com/search?q=how+to+write+a+property+editor+dialog+in+swing
You could take a look into the l2fprod components
(source: l2fprod.com)
Related
I'm using JavaFX integrated HTMLEditor. All the functions that it has are fine but I need to have also the function of inserting an image inside the HTML text.
Do you know some source which I could use? Or some other HTML (WYSIWYG) editor that could be used inside JavaFX and it has this functionality ?
I can program this functionality into the existing JavaFX HTMLEditor by myself, but I prefer to ask before I start doing something :)
Thank you very much for your answers ;)
I'd advise just customizing the existing JavaFX HTMLEditor, if it does most things you need with the exception of adding images and the look and feel of it is basically ok for you.
I created a code sample to assist in some JavaFX HTMLEditor customization tasks.
Another option you could toy with for a very basic html editor is a WebView with contenteditable set to true. Though I haven't tried it with images - maybe it will work ok.
If the above options don't work for you there there are heaps of javascript based editors out there to choose from.
I am trying to create a screen like this one
Initially I was trying to port a console program to java. I have found things like jcurses and charva but there is almost no documentation on them and I really cant understand how to use them.
So I figured that I could create a console like screen that resembled the one above.
what library / framwork would I be best using. Should I use swing as it if fully portable?
what would be the best approach being that I need to be able to navigate and alter the 00 in the picture above?
Easily usable would be great but as long as it has good documentation that I can learn it from that would be fine.
(Answering as if you're looking for a hex editor.)
http://jhecomponent.sourceforge.net/
http://www.fifesoft.com/hexeditor/
http://hexedit-lib.sourceforge.net/
Played a bit with the fifesoft.com offering, kinda cool.
If you're not looking for a hex editor, can you be more specific? If you just want a cursor-addressable window you'll probably have to suck it up and figure out something like jcurses or libjcsi :)
If you prefer to create a full fledged GUI with Java you could certainly use Swing. I would prefer SWT as a matter of personal taste, the widget library of Eclipse. You will find a lot of snippets and tutorials (same for Swing). Here is the Widget Library.
Here is a discussion about SWT versus Swing.
You could use the table layout manager to create the layout shown in your screenshot. If you rewrite the application from scretch, you should be able to handle the GUI events and update the widgets according to your application needs. You will easily find articles when you search for swt and table. If you would like to keep the code base and just exchange the GUI, I 'm not sure about the best approach. Maybe, the libs jcurses and charva are the way to go.
Unless you are looking to run the app on a headless VM (where a console/tty is all you've got), I'd use Swing. Create a JTable with a custom TableModel (to provide the data) and custom renderers (to provide the hex formatting) and everything should just work. Consider deriving from the various DefaultXXX implementations to save a lot of work.
I'm thinking about writing a simple UI designer in Java. I'm just playing with ideas at the moment to see if it is feasible.
It would be good to have something like this as all of our UIs are generated from XML. Just wondering if anyone has tried anything like this before. I know there will be a lot of effort in doing something like this.
Does anyone know of any 3rd party products that already do something like this?
If not then at a simple level, it will have drag and drop support for any component that can be positioned on a panel. Then extra bits will be added. Are there any good samples on the net for this?
Cheers
Dated back to 2005, this has an overview of Java UI Builders:
http://www.fullspan.com/articles/java-gui-builders.html
Here is a page on how to use the Eclipse Visual Editor:
http://www.ibm.com/developerworks/opensource/library/os-ecvisual/
Here is a good page on the different approaches to build UIs in Java:
http://leepoint.net/notes-java/GUI/misc/80gui-generator.html
Which GUI technology are you using? Swing? NetBeans has a very good drag-and-drop Swing GUI editor. For Eclipse there are several plugins.
If you want to see other projects in which a Swing GUI is generated from XML config files, there are different libraries that do this.
Eclipse 4.0 Developer Preview was just released with an xml based toolkit called XWT. It can be styled with CSS and has a GUI builder. This is a developer preview and there will be some changes over the next year as it progresses to release 4.1, but it is useable right now and the community support is really good.
Please forgive if this question has been asked numerous times. I recently installed Eclipse Classic v3.6.0 which I need to create a little utility using Java. In Visual Studio I can create a new form then from the Toolbar I can drag and drop components (Button, TextBox, ListBox, etc) onto the Form. Is this possible using Eclipse?
I have tried various (see below for a few examples) combination using both Stack Overflow and Google, but nothing that I have seen that discusses this topic. I have read that there are plug-ins for Eclipse and was thinking there might be a plug-in for this type of behavior? I am not sure if this feature is supported out of the box. Any help is greatly appreciated.
"eclipse form drag drop"
"using eclipse drag and drop form creation"
I have also found the following links that show examples for creating Form using SWT, but these are more of snippets. These are great if I want to generate the file myself, but I would like the IDE to most of that work (since I am lazy).
SWT Snippets
http://www.eclipse.org/swt/snippets/
SWT GridLayout
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTGridLayout.htm
SWT JFace Eclipse
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/CatalogSWT-JFace-Eclipse.htm
Thanks,
Mark
Instantiations SWT Designer is probably your best bet.
I'm trying to build a small application using Java and SWT for the GUI. I'm looking for a way to store in some file the preferences set by the user, I mean, if the window was resized then that new size should be saved for next time the application starts. The same thing with some controls like textbox and so on.
I came up with two ideas to solve this:
Use the classic hand-made .ini files to store those preferences. But it appears to be ugly and hard to maintain.
Serialization/Deserialization of the whole class that contains the GUI. Dunno if this is even possible.
Any ideas? What should I do?
Thanks in advance.
Added:
I'm not doing an Eclipse RCP project, it's just a normal SWT application.
More:
I've already tried with serialization, but SWT widgets doesn't support it, so the only other option that I've found is create another class, say Configuration, mark it as serializable and hold there the values of my widgets. Almost like using java.util.prefs.Preferences, but not as simple.
I'm still waiting to see if there is another way to do this, maybe with some binding involved.
Have a look at Memento design pattern.
Eclipse RCP already reuses this principle, you can refer to the following interface for more information:
org.eclipse.ui.IMemento