I'm new to the drag and drop features of java and I wanted to know if it is possible to drag and drop a short-cut from the desktop on a java jpanel and get info from it like icon .exe location and so on. I only found tutorials for text images and other java objects.
You can get the location of the file and all the data that Java is able to acquire about a File.
But I believe you cannot get icon.
Related
Im developing an SWT application which used JSCH api to download files from a server. There is an option to view the downloaded files in the application directly.
Im using a multi line text box which will display the file contents. Its all working till this point. Now i'm trying to add a search functionality which is going to have a new text box on top where user can enter the search keyword. The matching words should be highlighted in yellow background. I have used the code given in this link and its working
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SearchStyleText.htm
But im running out of heap space very very fast. Can I implement the same kind of code on Text instead of StyledText.
I have a editor developed which opens the xml file and display it there (with the proper structure), for this I need to browse through all the times to select target file, in what way I can add dragging in file feature enable for this ?
The report editor is developed with Java SWT components.
I want to know the possible ways or API available for "dragging in" file ?
This link might help you.
DragSource class which provides the drag and drip API in SWT.
http://www.java2s.com/Tutorial/Java/0280__SWT/DraggingandDropping.htm
I'm developping a Java application in which the user is able to change the background of a JFrame using a picture from his computer.
In order to do that I'm trying to get the path name of the picture he selects in windows explorer.
I use this code to open the explorer but I can't figure out what I got to do next to get the selected file path...
p = new ProcessBuilder("explorer.exe", "/select,C:\\directory\\selectedFile").start();
Any ideas ?
Thanks.
You should use a JFileChooser instead.
Then retrieve the selected file as a File object using the getSelectedFile() method.
Better option is JFileChooser for selecting a file.
I would suggest using JFileChooser.
That may be possible, but it is much easier to use a JFileChooser. You can set the look and feel to mimic the current environment (Windows, in your case). I recommend googling JFileChooser as there are tons of examples (including in the API).
I am using JavaFx-2.I need to view the pdf file in JavaFx. I searched in Google and found the below link.
http://www.idrsolutions.com/jpedalfx-viewer/
In this link I have created every thing whatever mentioned there and I am able to see PdfHelpPanel in Palette. When I drag this component to the PDFHelpFrame I am able to see the fileLocations property. Here I need to give the file locations but I don't know how to give the location of my pdf file. When I click browse in filelocations property it is asking for Custom Code, Default Editor, value from existing component. Which one I need to select. I am struck up exactly at
http://netbeans.dzone.com/articles/how-create-import-a-javabean-c-0
second image from last. If any one has done this already can you help me?
You can use this project https://github.com/james-d/PdfViewer
It uses PDFRenderer library.
Is it possible using java to create a dynamic graphs that update itself automatically when it receives values from outside?
I would create an application that check automatically the statistics of a server (data in,data out,etc...) drawing those values on the graph dynamically when those change.
I found JFreeChart but I don't know if it make those things
Go to JFreeChart demo's page, Download the jnlp and launch it via Java Web start. There are plenty of JFreeChart examples with source code. In the samples directory tree, under "Miscellaneous -> Dynamic charts" you'll find what you need