How can i open my Java aplication...

Hi everybody!
I was wondering how can i open my Java Picture Viewer by presing an picture.
When i am running the program with an argument like this
--> java JPic <path to picture> its ok.
But i want to press the image and automaticly open my Java Program.
How can i do that?
I have to use a native method?
The source of my program is here:
http://aetos.it.teithe.gr/~athoik/myprograms/jpic/jpic.html
Every help IS ACCEPTABLE AND NECESSARY.

I find it how it works. Al you need to do is make a script. So by presing a picture with your
mouse or on shell the program run with the specific picture as input :)
Cool!!
##### For Windos Script .bat ######
@cd C:\
@cd "C:\path to program\"
@java -jar JPic.jar %1
@pause
###### For Linux Script ########
@cd /where the program is
@java -jar JPic.jar $1

Similar Messages

  • How can I open in java file a text file?

    Hi !
    For example I have a java file name Pencil.java and I have a text fie name Box.txt
    I want like that if ( a == b ) {open Box.txt}
    How can I do that ?
    Thanks.

    Yes I want to see what this text file contains. Like clicking to a text file with mouse and opens. Then I can see what it contains.
    I have a Java document Pencil.java and I have a text file Box.txt
    I will write a java code in pencil.java ( that I dont know ). Then when I enter a number from keyboard with
    Scanner write = new Scanner(System.in);
    int a = write.nextInt()
    if (a == b) {                } opens Box.txt
    For example
    I write to command prompt
    java pencil
    It wants from me a number : I will enter 3.
    It is same as b .
    Then Box.txt file opens.
    Edited by: zue on Jun 3, 2008 11:04 AM

  • How can I open a java program through another program?

    Can someone tell me what's wrong with my code?
    <CODE>
    String thisFile = "javaw -classpath D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar directlink.DirectLink";
    try {
    Runtime.getRuntime().exec("cmd /C start " + thisFile);
    catch (Exception e) {
    </CODE>
    This code will handle other programs however I don't know how to write it so it will work with calling another class.

    Yeah, I made sure it was in the path. I even used the
    exact command from a command prompt. Well almost, I
    had quotes around the classpath.
    Eh? Quotes around the classpath? Sorry if I was being unclear. What I mean is when I call this from a command prompt I put double quotation marks around the classpath like so:
    javaw -classpath "D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar" directlink.DirectLink
    In the code on top I wrote it as a string and there were no quotation marks around the classpath.
    However, I'm not
    sure if I can use single quotes with java to simulate
    this or whether I can use a \" in it's place.
    I'm not sure what you're saying...but note that when you call exec you're not passing control to the shell, ?>so shell metacharacters are not interpreted.Once again sorry for not being clear. What I meant was I didn't know if I could write it like this:
    tempString = "javaw -classpath \"D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar\" directlink.DirectLink"
    And whether this would work. All I really was asking is how can I pass the command to cmd so it will interprete it as it did when I entered it in manually before. I wanted to pass the command to cmd with double quotation marks around the classpath because that's how I did it earlier. I just wasn't sure how to do it.
    What I'm wondering is since it's a java class is there a
    better way to call it especially since executing
    commands seems to be different between different OS's?
    You can invoke it directly. Why did you decide to create a new process?Frankly, I don't understand the command very well. I haven't had to use it before and I'm really just trying to get a feel for it. I usually like to get something working, play around with some options, get more of a hands on feel. Then I usually will do more research on it. I was looking at some posts on the exec command and I tried a few of them and this one worked for me when it came to opening apps so I decided to give it a try.

  • How can i open "my computer" in java

    How can i open ]my computer[b in java                                                                                                                                                                                                                       

    Two options:
    1) Execute
    Runtime.getRuntime().exec("explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}");2) Look at javax.swing.JFileChooser
    The first option will do what you want, but it is specific to Windows only (I tested it on XP, I don't know if it'll work on other versions). The second is cross-platform, but won't give you the same view as a native explorer.

  • Help--How can I open only one java program at one time?

    How can I open only one java program(same program) in Windows at one time?

    In Java 1.5, you can use the JVM's own monitoring APIs to examine what other JVMs are running on the system, and what applications they're running.
    It's general and powerful, but complex. The socket/file/whatever approach is cleaner, and probably more suited to your usage.
    Don't bother trying to use the Windows task manager for this sort of thing. You have to write messy native code, and it isn't reliable after all that anyway.

  • How can i let my java application closes the other opened windows

    how can i let my java application closes the other opened windows: like any other Microsoft Internet Explorer windows ... provided that my java application is not the one i used to open those other windows.... thanks in advance

    you'll have to use JNI to access the windowAPI
    then you need a list of window handles ... I think there was a function called getWindow and in order to close them you use sendMessage .... for details check out msdn (microsoft developer network)
    somwhere I saw a tool called JUtil, which might help you getting started on accessing the win api from java
    regards
    Spieler

  • How can i open the popup from java class

    Hi,
    Please tell me how can i open the popup from java class.
    I am using jdev 11.1.1.7.0
    I have used the below code which works fine in jdev 2.1 but it will have some errors in 11.1.1.7.0.
    Please tell me some way to do this in all jdev versions.
    Bean obj = (Bean)RequestContext.getCurrentInstance.getExternalContext.getPageFlowScope(“obj”);
    Code for hide pop-up
    FacesContext context = FacesContext.getCurrentInstance();
    String popupId = obj.getPopUpBind().getClientId()
    ExtendedRenderKitService service = Service.getRenderKitService(FacesContext.getCurrentInstance(),
    ExtendedRenderKitService.class);
    String hidePopup = "var popupObj=AdfPage.PAGE.findComponent('" + popupId +
    "'); popupObj.hide();";
    service.addScript(FacesContext.getCurrentInstance(), hidePopup);
    Code to Show pop-up
    StringBuffer showPopup = new StringBuffer();
    showPopup.append("var hints = new Object();");
    showPopup.append("var popupObj=AdfPage.PAGE.findComponent('" +
    obj.getPopUpBind().getClientId() + "');popupObj.show(hints);");
    service.addScript(FacesContext.getCurrentInstance(), showPopup.toString());
    Code need to be added in jsff pop tag
    binding="#{pageFlowScope.bean.popUpBind}
    Variable need to be added in Bean.java
    private RichPopup popUpBind;

    Hari,
    Since you're using a non-public build of JDeveloper, you should be using a non-public forum.
    John

  • How can we open any file using JAVA...

    Hi all
    i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();)
    but the thing is how can i open that file for example if that file is HTML file then opens in IE or if that file is MS Word document that open in Word, like that
    is there any suggestions
    Thanx
    Regards
    Satinderjit

    start is a windows command-line utility.
    start foo.doc will start Word (or Star Office or Word Perfect or whatever is registered for the .doc extension),
    start bar.htmnl will start your registered browser etc.

  • How can I get controller .java files

    I have craeted OA extension pages in which I have created Entiy object, module and view objects
    in JDeveloper for 12.1.1 in windows and it working fine.
    Now I want to extend one of the page of payable module (payable vision operation (USA))
    and the page name is SuppSummaryPG.xml .
    The problem is that how can I open or import SuppSummaryPG.xml in my jdeveloper ID
    and all the related files which belongs to SuppSummaryPG.xml , example raleated VO, entity objects
    module file and controller servlet.
    I move all the files from
    apps server to jdeveloper directory , i did the same thing which is running
    and working fine but the problem is with all of ViewObject and aplication module
    I am not able to open these in Jdeveloper , because when I try to open these files
    it gives me error that you dont have .java files , and it opens view objects and applicatino
    moudel files in read only mode
    the page is a standrad java moudle page
    suppSummaryPG is a standard page and it is in
    payable moudle herachy is
    oracle/apps/pos/supplier/....suppSummaryPG
    what should I do

    You can use decompiler to read java code. Oracle doesn't have any policy to prevent you from reading the class files.
    However you cannot change the java code and replace the standard files.
    Source Code:
    Oracle sells the just the software. So they are not obligated to provide source code.
    The reason why they provided soruce code for forms and reports is that there is no robust personalzation and extention concepts available for them.
    As per Oracle Support services, you dont need OAF code for extension and personalization.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can i open the archived pst file in my Mac Air

    How can i open the Archived outlook pst file in my Mac air, i want to access my old outlook mails.

    System.setProperty("java.security.policy", "system.policy");Is this a new feature in JDK1.4? I don't see it in
    the documentation for JDK1.3.1 that I'm currently
    using.Look more closely. There is indeed a setProperty(String, String) in
    http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html
    "Since 1.2"
    - Marcus

  • How can I open a picture with Jtree

    hi,
    I want to write a Filemanagerprogramm with JTree, but how can I open it, after I clickt the .jpg or .png file. Thank you for your Tip!

    The java tutorial at http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html will tell you a lot of what you need to know.

  • How can I open "Place..." dialog from my plugin?

    Hello All,
    There is a "Place..." item in  "File -> ...". If we can click on "Place...",  "Place" dialog will open and asks for .ai file to place the whatever the art is there in that file in the current document. Right.
    Now what I want is, if I click on one of the button in my plugin UI, "Place" dialog will open and art will be drawn in the current document.
    I looked into the API documentation and found AIPlacedSuite::ExecPlaceRequest( ) function, but no use.
    How can I open "Place" dialog from my plugin?

    The SDK does not provide any calls to open the Place dialog directly.
    You have a few potential solutiuons, however.
    A. Implement your own file dialog box, and use the Place suite. Which I think is perhaps the most elegant solution.
    B. Programitcally create an action that opens the Place dialog. You can record an action that does this to see what file would have to be written (see "Insert Menu Item..." then type "Place", enter while recording). Then you could call the action with the Action suite.
    C. The dialog could be opened using the scripting capabilites (for instance AppleScript). Your program could then write/call the AppleScript. I know it can be done with AppleScript, and I suspect other scripting languages such as Java might be able to do it.
    Hope this helps.

  • How can I open other projects?

    I want to open projects, which &#305; download in planetsourcecode.com in netbeans or in Sun Java Studio Enterprise 8.1.
    The problem is that open dialog of JSE or netbeans looks for a directory. And if I try to open the directory which I have downloaded, it doesnt open the project. I tried to do same with my project (made in netbeans) and there was a small sign bottom of the directory icon. And it opened project succesfully. How can I open other projects?

    Probably best to firstly copy the media folder - you could Option/drag it to the desktop. Then open a new project and go File/Import that desktop folder.
    Let us know if that works out for you.

  • How can I open CS5 in mavericks

    How can I open CS5 in mavericks   The javaforOSX2014 won't open

    It should. I too had to upload the correct java - this is the version that the Adobe launcher is sending you after, no?

  • How can I open the links on the TreeItem treeItem1 = new TreeItem("Fish", "

    JDeveloper 11g, Windows 7(64 bit), ADF Faces
    package view.backing;
    import java.beans.IntrospectionException;
    import java.util.ArrayList;
    import java.util.List;
    import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
    import org.apache.myfaces.trinidad.model.TreeModel;
    public class TreeModelAdapter {
    private Object _instance = null;
    private transient TreeModel _model = null;
    public TreeModelAdapter() {
    ArrayList<TreeItem> rootTreeItems = new ArrayList<TreeItem>();
    TreeItem treeItem1 = new TreeItem("Fish", "http://www.someurl1.com");
    TreeItem treeItem2 = new TreeItem("Dog", "http://www.someurl2.com");
    TreeItem treeItem3 = new TreeItem("Cat", "http://www.someurl3.com");
    TreeItem treeItem2_1 = new TreeItem("Blue Heeler", "http://www.someurl4.com");
    TreeItem treeItem2_1_1 = new TreeItem("Rover", "http://www.someurl5.com");
    TreeItem treeItem2_1_2 = new TreeItem("Ruffus", "http://www.someurl6.com");
    rootTreeItems.add(treeItem1);
    rootTreeItems.add(treeItem2);
    rootTreeItems.add(treeItem3);
    ArrayList<TreeItem> treeItem2Children = new ArrayList<TreeItem>();
    ArrayList<TreeItem> treeItem2_1Children = new ArrayList<TreeItem>();
    treeItem2Children.add(treeItem2_1);
    treeItem2.setChildren(treeItem2Children);
    treeItem2_1Children.add(treeItem2_1_1);
    treeItem2_1Children.add(treeItem2_1_2);
    treeItem2_1.setChildren(treeItem2_1Children);
    this.setListInstance(rootTreeItems);
    public TreeModel getModel() throws IntrospectionException {
    if (_model == null) {
    model = new ChildPropertyTreeModel(instance, "children");
    return _model;
    public void setListInstance(List instance) {
    _instance = instance;
    _model = null;
    How can I open the links on the TreeItem treeItem1 = new TreeItem("Fish", "http://www.someurl1.com"); on a new page?

    In your af:tree nodeStamp facet you have access to the node (TreeItem in your case). If your TreeItem has a getter method for the url (you did not provide the TreeItem code) you can put an af:goLink in the nodeStamp and set the destination attribute to #{node.url} and set the TargetFrame of the golink to '_blank':
    <af:tree ...>
      <f:facet name="nodeStamp">
        <af:goLink text="goLink 1" id="gl3" destination="#{node.url}" targetFrame="_blank"/>Timo

Maybe you are looking for