I'm using the latest version of JavaFX and I'm trying to open a user dialog to select multiple folders at once. I know you can do it in Swing but I'm trying to do it in JavaFX. I tried using DirectoryChooser but as far as I can see there is no method that allows you to choose multiple directories. Does anyone know how I can go about this or should I just use Swing?
Related
I'm using the DirectoryDialog component in my application to let the user select a folder.
Now I want to have the possibility to prevent the user from choosing a specific folder. Is there a handler or listener or something like that?
This can't be done.
DirectoryDialog is just a thin wrapper around the native open directory dialog (for example on macOS it uses NSOpenPanel). The native dialog is very different on the various platforms supported by SWT making it not practical to allow this.
You could craft your own directory dialog using a TreeViewer and the native file APIs.
I am currently using a bunch of eclipse, jface libraries to build a small editor. I am using eclipse's SourceViewer for it. I am trying to highlight/change the color of parts of my code in eclipse however I don't think I can use the concept of damager, repairer and PresentationReconciler because I want to highlight lines of code based on user selection. So if a user selects some code I can get the selected code by using
SourceViewer.getSelectionProvider().getSelection();
Which would return an ISelection and thats what I want to "Highlight". I am currently able to create Annotations which essentially creates squigglies under the text the user selects I would rather change the color of the selected text. Would much appreciate any help.
edit:
I am not developing as an eclipse plugin but as a standalone application using the plugin api's.
I've been trying develop my custom plugin for Eclipse, and basically I want to make is a "richer" version on the current TextHover. I don't know what widget(?) Eclipse uses to display the hovering text, but I want to use something different, like SWT Image or SWT Browser.
Most of the tutorials that I've read suggest that I have to implement my own Java Editor to do this, but I don't want the user to switch to my custom editor just for a simple feature (and I don't want to implement a whole editor).
Some Tests:
I've already created two Eclipse Plugin Projects. The first one is a extension for the JavaEditorTextHovers, and with this project I managed to show some custom Strings when hovering some random texts, but wasn't able to change the hover appearance. The second project was a editor plugin. With this last one I managed to get a Browser to appear when hovering a random text(this tutorial helped me), but again, this editor had nothing, no syntax coloring, no rules, etc., and for the previous reasons, I couldn't accept this has a solution.
Maybe if there was way to change the (or set a new) SourceViewerConfiguration of the current editor I could pass my custom SourceViewerConfiguration, but I'm not sure if this is possible.
Friends i am trying to develope a desktop application it's requirement is
1.It should have 2 browse button after clicking on that file open box should appear like
jfilechooser in swing
2 Then i have to select that file and require it's url for future use.
3.My application contains just 2 buttons and on clicking on that i want to call a function that compare that file(logic for that i already written)
4.I am using eclipse for that
so overall i can say my application is simple so what should i use javafx or swing for gui?
if any other conveniant option is present please tell me.please give me option which are open source
You could implement it using Swing.
If you want it to be on a variety of devices (desktops, mobile or browsers) then choose JavaFX.
If u require rich look and feel in your application,use JavaFx.Otherwise Swing is also good.
So I built a program in Java using swing for the interface and i didn't realize how difficult it would be to convert it to be used as an android application. Is there any way for me to easily convert or rebuilt the program to be sold in the android market place? If not can anyone point me toward any resources to help build a android.
I did the same thing awhile back. Although there is no program out there that I know of to convert it directly. The Java code and the android code are very similar. Since android doesn't use swing's UI it uses XML based UI. once you get the UI functions of the android app down your Java code can be easily imported.
I am working on converting my Java app into an android app now. Most of my classes imported with no problem.
AjaxSwing allows to convert Swing applications and use them directly on android or ipad, see http://www.creamtec.com/products/ajaxswing/solutions/java_swing_ui_on_ipad.html
What I would do is that I would build the UI in XML, then I give the items an ID and reference to it in Java, and then I'll trigger everything by button clicks so what one button does in your swing layout does the same on android. You can't copy/paste it.
swing UI was meant for desktops and pc's but for
android you have to use Xml then you can keep your java codes as they are in the various activities
then use your event handling skills to trigger them
Open the project's properties
Select Java Build Path
Select Libraries tab
From there you can Add External Jars and you can use swing layout