I have developed a java gui that contains two jTextField views for displaying the source and destination file paths. And , the user selects more than one file path , i would like to display previous paths in a pop-up attached to the jTextField. This is a common feature in almost all app.
Does anyone knows how this is called, in order to google how to do it?
It is called editable JComboBox.
Related
I have created a JFrame application in Netbeans, which has user creation and user log in for a tutorial application I am making, how would I populate a JComboBox from a text file when a user is created?
I have created the application/user creation, But I am stuck on the JComboBox selection from the file... I have seen multiple things on how to, but nothing is working at this time.
The application takes a persons:
First Name
Last Name
Desired Username (The thing I want in the JComboBox)
And the log-in is literally just selecting the user from the JComboBox and listing all users created and clicking a button to log-in. The text file is located: F:\ProjectDecember\Users.txt
Any help would be appreciated.
Thank You.
Check out Combo Box With Custom Renderer.
It shows how you can create a custom renderer for your custom Object that you add to the combo box. It also shows an approach that you can use so you don't break the default functionality of the combo box when you use this custom renderer.
I am running an applet in IE which is generated from an external VLX file.
The VLX file is pulling data from a database and when a user hover overs a specific icon when the applet is running, a hover over table appears, with four strings inside, more specifically one of the strings is a URL.
When viewing source it is not possible to see these string values, as they are generated by the VLX and then used by the applet, so the only code you can see is the applet code.
Is it possible to retrieve these strings? As I want to be able to use the URL to open a new web page.
I have it so when a user double clicks the specific icon, an alert is present to show where I am on the page, and within this event I need to use URL value.
This is not possible with the document.getElementById as these values are not accessible in the html.
i am developing a plugin that calculates the class metrics of the selected java file.
so, m using IWorkbenchWindowAction delegate to add the plugin button and menu option.
by selecting the java file, and clicking on the plugin button,
i obtain the pathname of the selected file, and now
i need to calculate the metrics over it.
suppose i have already calculated the metrics.
now, i want to display them in tabular form.
what needs to be done ???
how can i display a table , and display it as soon as the plugin button is pressed (after calculating the metrics, ofcourse).. ??
You must probably create your own view, with table (Viewer) inside it. Updating viewer strategy can be different. For instance, you can make your view listen to some events, which are generated after the metrics are calculated. Or, if you want to have a separate button for updating the view, then you should attach proper action/command handler with necessary logic. Does this answer your question, or I am missing something?
I am creating an application that converts files from xml to pptx. The user will drag items from a JTree to a JList to create the slide. I have managed to get everything working but the JList seems to disappear after the drop. I know the drop is received because of print statements, and that it's not null. The JList is still there I believe, because I can print the items in the array. Through testing, I think that something is wrong in the custom DefaultListModel I have created. It is not calling an update/redraw/revalidate after the drop for some reason, or has released its action listeners because I notice that the getSize and getElementAt methods stop getting called after the drop. It does however draw correctly if I add items to the ListModel on app init.
I've been looking through all the documentation on ListModels and TransferHandlers but have not been able to get the List to display after the drop. Is my model missing an Override or not handling listeners in some way?
Full source:
http://code.google.com/p/app4args/
Possible problematic file:
http://code.google.com/p/app4args/source/browse/trunk/src/edu/gatech/app4args/utils/CustomListModel.java
To recreate:
Download latest release/source & example xml file from downloads section of project site
Run app, choose File > Import, browse to example xml file
Create new slide: Slide > New Slide, choose Standard (any works)
Drag JTree item from Library to a List in Slide Content View
List does not update, clicking on it or elsewhere in the app and back on the list will make it disappear
Thanks
Turns out I was overriding methods in CustomListModel that were relevant to the updating of how to draw the content of a list. I removed these and reworked a few things and it is correctly drawing now.
I have a JCheckBox that should not be checked by the user when a certain other field is empty.
So now I want to have an error popup and then reset the checkbox (I've considered disabling the checkbox, but the connection to the other field is non-obvious, and a tooltip text IMO not visible enough).
What's the correct way to do that in Swing? Through a PropertyVetoException? Where do I throw it and where do I catch it? My first (probably ugly) idea would be to add a ChangeListener that itself shows the popup and resets the value.
Edit: The question is about Nikki (screenshot below), an app I am developing which geotags images and exports them to Google Earth's KMZ format. The checkbox is used to select the images to include in the export. But this requires the images to be gotagged first (which in turn requires either a timestamp, or manual assignment). I don't think this requirement can be made obvious through the UI layout.
(source: brazzy.de)
I would simply disable the check box and add a message explaining why the option is not available. A nice way to show the message is to display a mini exclamation mark next to the check box and put the message in a tooltip.
Poping up an exception often feels wrong because users don't read error messages. For most users an error message popup means that the application did something wrong, in your case it's the normal behavior.
Edit if you insist on letting the check box enabled, another way to show the user that some info is missing would be to flash the missing data. Eg. if latitude and longitude are missing and the user clicks on export, set a red background onto these fields for a just a second. This will clearly show the user what's missing.
In this screen, don't you want to put the mouse over the red circle to understand what's going on?
validation http://www.vogella.de/articles/EclipseDataBinding/images/validation10.gif
I don't think the Export JCheckBox should be disabled at all. Instead, the Export JButton itself should examine the current export list and display any anomalous entries in a way that allows navigation to a chosen photograph. If all entries are correct, Export would proceed as usual.
Addendum: It think you are right to keep the interface as non-modal as possible. My model for this would be unsaved files when exiting an editor or uncommitted changes when closing a project in an IDE.
If that's a status line at the bottom of the window, you might indicate the number of photographs currently selected for export, adding a count if any still need geocoding.
The field should simply be allowed to disable the checkbox. If the coupling is unintuitive then the GUI layout may have to be reconsidered.
EDIT: I ran it from your page, and I believe the issue here is that you actually have a third and fourth step in addition to select folder, select images. The third step is validate image, and fourth is select images for export. I think your problem is that this is not clearly conveyed in the current layout, and that reflects in your question.
I would suggest that you create a separate column containing the checkbox for each image, and that THAT checkbox is disabled until the image passes validation (step 3). Perhaps with an explanatory text in the column about why the image hasn't passed yet.