How do I convert my GUI java app to be an applet or display it on a webpage

I have created a loan calculator program in netbeans, I got the application to run fine but now I want to add it into a html page.
I'm just looking for a place to start, I just don't know where to go from here, I want to know if I can actually convert my app with a few changes to an applet or if any one can point me to a forum of similar interest or tutorials that explain what I'm looking for.
I don't even know what i'm looking for except i want this program to run on a webpage.
Or is there a way to run my .jar file on a webpage??
My teacher has not taught us anything on this matter except the below code suggestions on converting and my program is more extensive than her examples for converting. This is what she briefly described on this subject.
1.To convert an application to an applet the main differences are: import java.awt.Graphics; import javax.swing.JApplet; import javax.swing.JOptionPane;
     Extend JApplet Replace main with public void init() method
Output with public void paint( Graphics g ) method
2. Remove calls to setSize, setTitle, pack, and any window listener calls, e.g., setDefaultCloseOperation. Compile the program---if something doesn't compile just comment it out for now.
3. Create a simple web page with the following body.
<applet CODE="__________.class" WIDTH="300" HEIGHT="300"
archive="http://www.cs.duke.edu/courses/fall01/cps108/resources/joggle.jar">
Your browser does not support applets </applet>
I understand those steps for a simple program like hello world but not my current app
Heres my code on the 2 extend off my first GUI of the Loan Application
public class AnalysisGUI extends GUI {
    /** Creates new form AnalysisGUI */
    public AnalysisGUI(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }//end constructor
    private DecimalFormat currency = new DecimalFormat("0.00");
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
        analysisjButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        writejTextArea = new javax.swing.JTextArea();
        clearTextAreajButton = new javax.swing.JButton();
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        analysisjButton.setText("Analysis");
        analysisjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                analysisjButtonActionPerformed(evt);
        writejTextArea.setColumns(20);
        writejTextArea.setRows(5);
        jScrollPane1.setViewportView(writejTextArea);
        clearTextAreajButton.setText("Clear Analysis Output");
        clearTextAreajButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearTextAreajButtonActionPerformed(evt);
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(analysisjButton)
                    .addComponent(clearTextAreajButton))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 433, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(86, 86, 86))
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(306, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(analysisjButton)
                        .addGap(84, 84, 84)
                        .addComponent(clearTextAreajButton)
                        .addGap(113, 113, 113))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(22, 22, 22))))
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-700)/2, (screenSize.height-627)/2, 700, 627);
    }// </editor-fold>
    private void analysisjButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
        // TODO add your handling code here:   
        //importing values for FOR loop of 13 pyaments a years
        ir13 = super.rate;
        balance13 = super.balance;
        time13 = super.time;
        payment13 = MortgageCalculator.CalculatePayment(ir13, balance13, time13, PayperYear13);           
        interest13 = round((balance13 * (ir13/PayperYear13)));                   
        principle13 = round(payment13 - interest13);
        //set up for 12 pyaments a year
        balance = super.balance;          
        ir = super.rate;
        time = super.time;         
        payment = super.payment;
        interest = round((balance * (ir/PayperYear12)));
        principle = round(payment - interest);
        //set up for 24 payments a year   
        balance24 = super.balance;          
        ir24 = super.rate;
        time24 = super.time;         
        payment24 = super.payment/2;
        interest24 = round((balance24 * (ir/PayperYear24)));
        principle24 = round(payment24 - interest24);
        //set up for 26 payemnts a years
        ir26 = super.rate;
        balance26 = super.balance;
        time26 = super.time;
        payment26 = MortgageCalculator.CalculatePayment(ir26, balance26, time26, PayperYear26);           
        interest26 = round((balance26 * (ir26/PayperYear26)));                   
        principle26 = round(payment26 - interest26);
     double totalPrinciple = 0;              //set to zero
     double totalInterest = 0;          //set to zero       
     for( int n = 0; n < time; n++)     //check Year of Loan
            totalPrinciple = 0;          //reset to zero for totaling Year n totals
            totalInterest = 0;          //reset to zero for totaling Year n totals
            writejTextArea.append("-----Based on 12 Payments Per Year-----\n");
            writejTextArea.append("          "+"          "+"Principle" + "    " +
                "Interest"+ "    "+
                "Balance"+"\n");            
            //loops through the monthly payments
            for(int i = 1; i <= PayperYear12; i++ )
            //Calculate applied amounts for chart to be printed
            interest = round((balance * ir)/PayperYear12);
            principle = round(payment - interest);
            balance = round(balance - principle);
            //total year end amounts
            totalPrinciple = totalPrinciple + principle;
            totalInterest = totalInterest + interest;
            writejTextArea.append("Payment " + i + " $" + currency.format(principle) + "     " +
                currency.format(interest) + "      $" +
                currency.format(balance)+"\n");     
            }//end for 12 payments per year
            //print 12 payments Totals          
            int yr = n + 1;
            writejTextArea.append("\n---Year " + yr + " Totals Based on 12 Payments Per Year---");
            writejTextArea.append("\nYear Total Principle: $" + currency.format(totalPrinciple));
            writejTextArea.append("\nYear Total Interest: $" + currency.format(totalInterest));
            writejTextArea.append("\nRemaining Balance: $" + currency.format(balance)+"\n");
            writejTextArea.append("\n-------------------------------------------------------\n");     
            //Start 13 PAYMENTS A YEAR TABLE
            double totalPrinciple13 = 0;          //reset to zero for totaling Year n totals
            double totalInterest13 = 0;          //reset to zero for totaling Year n totals
            writejTextArea.append("-----Based on 13 Payments Per Year-----\n");   
            writejTextArea.append("          "+"          "+"Principle" + "    " +
                "Interest"+ "    "+
                "Balance"+"\n");            
            //loops through the monthly 13 payments           
            for(int j = 1; j <= PayperYear13; j++ )
            //Calculate applied amounts for chart to be printed
            interest13 = round((balance13 * ir13)/PayperYear13);
            principle13 = round(payment13 - interest13);
            balance13 = round(balance13 - principle13);
            //total year end amounts
            totalPrinciple13 = totalPrinciple13 + principle13;
            totalInterest13 = totalInterest13 + interest13;
            //System.out.printf("\n%-10s %-10s %-10s %-10s %-10s", n + 1 , i + 1,Principle, Interest, Balance);
            //System.out.printf("\n%-10s %-10s %-10.2f %-10.2f %-10.2f", n + 1 , i + 1,round(principle), round(interest), balance);
            writejTextArea.append("Payment " + j + " $" + currency.format(principle13) + "     " +
                currency.format(interest13) + "      $" +
                currency.format(balance13)+"\n");         
            }//end for 13 payments per year
            //Print totals for 13 payments a year          
            yr = n + 1;
            writejTextArea.append("\n---Year " + yr + " Totals Based on 13 Payments Per Year---");
            writejTextArea.append("\nYear Total Principle: $" + currency.format(totalPrinciple13));
            writejTextArea.append("\nYear Total Interest: $" + currency.format(totalInterest13));
            writejTextArea.append("\nRemaining Balance: $" + currency.format(balance13)+"\n");
            writejTextArea.append("\n-------------------------------------------------------\n");             
            //Start 24 PAYMENTS A YEAR TABLE
            double totalPrinciple24 = 0;          //reset to zero for totaling Year n totals
            double totalInterest24 = 0;          //reset to zero for totaling Year n totals
            writejTextArea.append("-----Based on 24 Payments Per Year-----\n");
            writejTextArea.append("          "+"          "+"Principle" + "    " +
                "Interest"+ "    "+
                "Balance"+"\n");            
            //loops through the monthly payments
            for(int i = 1; i <= PayperYear24; i++ )
            //Calculate applied amounts for chart to be printed
            interest24 = round((balance24 * ir24)/PayperYear24);
            principle24 = round(payment24 - interest24);
            balance24 = round(balance24 - principle24);
            //total year end amounts
            totalPrinciple = totalPrinciple + principle24;
            totalInterest = totalInterest + interest24;
            writejTextArea.append("Payment " + i + " $" + currency.format(principle24) + "     " +
                currency.format(interest24) + "      $" +
                currency.format(balance24)+"\n"); 
            }//end for 24 payments per year
            //print 24 payments Totals
            yr = n +1;
            writejTextArea.append("\n---Year " + yr + " Totals Based on 24 Payments Per Year---");
            writejTextArea.append("\nYear Total Principle: $" + currency.format(totalPrinciple24));
            writejTextArea.append("\nYear Total Interest: $" + currency.format(totalInterest24));
            writejTextArea.append("\nRemaining Balance: $" + currency.format(balance24)+"\n");
            writejTextArea.append("\n-------------------------------------------------------\n");                        
            //Start 26 PAYMENTS A YEAR TABLE
            double totalPrinciple26 = 0;//reset to zero for totaling Year n totals
            double totalInterest26 = 0;     //reset to zero for totaling Year n totals
            writejTextArea.append("------Based on 26 Payments Per Year-----\n");
            writejTextArea.append("          "+"          "+"Principle" + "    " +
                "Interest"+ "    "+
                "Balance"+"\n");            
            //loops through the monthly payments 26 times
            for(int i = 1; i <= PayperYear26; i++ )
            //Calculate applied amounts for chart to be printed
            interest26 = round((balance26 * ir24)/PayperYear26);
            principle26 = round(payment26 - interest26);
            balance26 = round(balance26 - principle26);
            totalPrinciple = totalPrinciple + principle26;
            totalInterest = totalInterest + interest26;
            writejTextArea.append("Payment " + i + "  $" + currency.format(principle26) + "     " +
                currency.format(interest26) + "      $" +
                currency.format(balance26)+"\n");
            }//end for 26 payments per year           
            yr = n + 1;
            //prints 26 payments yearly totals
            writejTextArea.append("\n---Year " + yr + " Totals Based on 26 Payments Per Year---");
            writejTextArea.append("\nYear Total Principle: $" + currency.format(totalPrinciple26));
            writejTextArea.append("\nYear Total Interest: $" + currency.format(totalInterest26));
            writejTextArea.append("\nRemaining Balance: $" + currency.format(balance26)+"\n");
            writejTextArea.append("\n-------------------------------------------------------\n");                
        }//end for years of the loan
    private void clearTextAreajButtonActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        //clear analysis field
        writejTextArea.setText("");
    public static double round(double r)//round to cents method
          return Math.ceil(r*100)/100;
     }//end round  
    /**HI micha what a long progam
     * @param args the command line arguments
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                AnalysisGUI dialog = new AnalysisGUI(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                dialog.setVisible(true);
        });//end announymous
    }//end main mehtod
    //12 year declared varialbes
    //private double balance;   
    private double principle;
    private double ir;
    private double interest;
    private double PayperYear12 = 12;
    //Variables for 13 payments a years
    private int PayperYear13 = 13;
    private double balance13;
    private double principle13;
    private double ir13;
    private double interest13;
    private double payment13;
    private double time13;
    //Varialbes for 24 payments a year
    private int PayperYear24 = 24;
    private double balance24;
    private double principle24;
    private double ir24;
    private double interest24;
    private double payment24;
    private double time24;
    //Varialbes for 24 payments a year
    private int PayperYear26 = 26;
    private double balance26;
    private double principle26;
    private double ir26;
    private double interest26;
    private double payment26;
    private double time26;
    // Variables declaration - do not modify
    private javax.swing.JButton analysisjButton;
    private javax.swing.JButton clearTextAreajButton;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea writejTextArea;

Your original program extends "GUI" which appears to extend JFrame (correct me if I'm wrong). If so, the first thing you should do would be to re-write this so that it extends JPanel which shouldn't be that hard to do (at least it's not hard to do if you know a little Swing -- but I worry about someone coming into this from the netbeans-generated code world). Purists will tell you to not even extend this, to have your main GUI class hold an instance of JPanel instead, and this would work fine too, as long as one way or another, the main GUI program can produce your application displayed on a JPanel on demand.
If you've done this correctly, then using your JPanel in a JFrame is trivial: in a main method create a JFrame, and then simply add your JPanel to the JFrame's contentPane and display it. Likewise using your JPanel in a JApplet is just as trivial as you'd do essentially the same thing: add your JPanel to the JApplet's contentPane, but this time do it in the JApplet's init method.

Similar Messages

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Failure with embedding GUI java app into VC++ MFC app

    I have the GUI Java application, wich I wish to be embedded into MFC application. But VC traces the message about unhandled exception and message "HEAP[app.exe]: HEAP: Free Heap block 3c40418 modified at 3c40438 after it was freed. Unhandled exception at 0x77f9193c in app.exe: User breakpoint." I had builded short tests. So console win32 apllication with gui java works and gui mfc without ui java too. Loading and unloadig the JVM is implemented in InitInstance() and ExitInstance() methods of main MFC app class. Which native thread is "main" for JVM is stored and verified when JNI-functions are called from another native thread. Java gui as it's own message processing thread which shouldn't confuse the native MFC one. Every Java-class method JNI-call is provided by exception checking. I'm at loss where to dig. Could you give me any hint, please?

    Well, I missed the right place for my post, sorry. It should be placed at "Native methods"...
    I had selected JVM 1.4.2_08 (it was 1.5.0_04 at first) for running Java part and the failure had gone away. Though I can't unload JVM DLL before exitting correctly anyway cause my program uses OLE and jvm.dll unloading provokes the memory access exception at awt.dll through ole.dll down the call stack. The test Java program works, but sometimes mouse cursor doesn't change it shape. It happens with Swing tables. There are no faults with columns exchange or cell editors activation but mouse cursor remains "arrow" when cell editor is active or I change the column width with mouse.

  • How to connect to mysql from java app

    hi
    please say the procedure for connecting to mysql database from java app.
    .) what should i give in environmental variables
    .)where can i find the driver class for the mysql
    .) syntax of the url
    eg:- DM.getConnection("jdbc:mysql:..............what comes here..............");

    You can also get connections from a DataSource. Simple example:
                MysqlDataSource msds = new MysqlDataSource();
                msds.setUrl("jdbc:mysql://127.0.0.1:3306/dbdame");
                msds.setUser("user");
                msds.setPassword("pass");
                Connection c = msds.getConnection();Explore your options and be sure to consider connection pooling.

  • How to run a makefile from java app?

    Hi,
    I want to run a make command the first time my java swing application is run. The makefile is in a directory that the application is using for input files. Do I need to write a script to house the make command or is there another way to run make?
    Thanks

    Thanks for that but I'm not actually trying to build a makefile for my java app - I just want to be able to run one that is going to generate a bunch of html files for my application to access. The make command works great from the command line but I can't just put a directory followed by "make html" in a string and run it using runtime.exec in my application.

  • How do I convert CS6 Design Standard Apps to CC Apps?

    I tried Deactivate, Restart, Activate, did nothing when I opened the equivalent CC App.  I tried changing the language to English (international), did nothing also.  How do I do this?

    You don't "convert" CS6 apps to CC apps.
    If you have a trial or a subscription to CC, you just download the apps. Do you have a trial or a subscription?

  • How to user netbean to follow java app logic flow

    I imported a j2se application (about 60 classes) into the netbean IDE, I was able to compile and run it. I am new to this program and would like to use netbean to execute this app step by step to follow the logic flow of the program and to understand this program. How do I do that?
    Thanks

    You don't NEED an IDE such as JBuilder, but it does make things a little easier.
    What I'm guessing you have is a bunch of .class files and you want to turn it into something compact and executable, right? The best thing to do is create an executable .jar file. Jar is a type of compressed archive similar to Zips.
    In the JDK, there is a program called jar.exe which you can use to pack your classes into a JAR file. To run a jar file, in the command prompt, or a batch file, simple write "java -jar MyApp.jar". You can also run a Jar file just by doubleclicking it by setting: java.exe "-jar" "%L" in the file types menu in explorer.
    If you have something like JBuilder, you can make it automatically create the Jar file when you build your app.

  • How do I convert ClobDomain to java.sql.Clob?

    I have an instance of oracle.jbo.domain.ClobDomain and i need
    to convert it to oracle.sql.CLOB. How do I do this?

    Sascha, I tried your solution:
    clobData = (CLOB) content.getData();
    Alas, it does not work. Although content has a value, clobData becomes null
    Also, if I take a look in the source ClobDomain.data, the method getData has the following
    comment:
    * Internal:Applications should not use this method.
    Does anybody know a way out?
    lebbol

  • How to implement secure Licencing for Java Apps?

    Hi
    I'm already thinking some months about this topic. I serached the web, some books and magazines, i asked quite a lot of people - but in the end, there seems to be no really satisfying answer.
    My main question is: what can i do to protect the software i wrote? The problem is, where ever i start, i end with open questions.....
    I may start delivering a custom licence key with my software that contains information i.e. about who may run it and for how long. To check integrity i sign the licences key (with a digest) and ckeck the integrity in the application. Like this, i could make sure, that the software runs only with a valid licence.
    But two new problem araise - if the licence key is given to the web, everyone will be able to run the software. Second, i have to implement a methode to check the digest, so i have to deliver the key with the software and like this, the key could just be used to generate new licence files. Third, i hav to protect my code, since anyone could recompile it, he could check the algorithms i use to check the digest and even worse, he just could disable the codeblock that checks the licence.
    So i use an obfuscator to scramble my code, and to get the most out of this technique, i use a controlflow obfuscator. This adds some security, but still the code can be decompiled but wouldn't be too easy to understand. For making it even a little bit harder to read, i will "distribute" the licence digest check over some different classes.
    But still the first two problems remain. So i think about encrypting the licence file. To make that secure, i would use a public/private key encryption since if i use a secret key encryption i would have to deliver the key with the software and anyone could use it to generate new encrypted licene files. The problem with the public/private key is, that i should deliver a public key with the software that is only capable of decrypting, but not of encrypting. Like this, i can implement a decryption methode in the software that can decrypt the licence file and read all requiered licence data but the user is not able to generate a new licence file because he has the read-only key. Obvisouly there is no such private/public key technique that allows one key to be decrypt only and the other to be encrypt and decrypt (or at least encrypt only). Algorithms like PGP have a public key that allows encryption only and a private key that allows decryption only.
    I could go on presenting some more ideas i found to "protect" software/licence but the all come to the same point where they leave a lot of other open questions.
    I wonder what you all out there do to protect your software, what kind of technique you use for licencing implementation. I would be very glad to read what problem you face reagarding this topics and maybe how you solved it or what your conclusion was.
    Greetings
    josh

    >
    yes, absolutely. That's the point. Try to make it hard
    to get the software some other way. So it's easer to
    get the software by buying it.
    Nope.
    - There are those who steal it just to steal it. They don't use it.
    - There are those who steal it because the price is too extreme. If your income for the year is measured as only several thousand dollars you are not going to be able to buy a package that costs a thousand dollars or more.
    - There are those who steal it because the preceived benifit is less than the cost. For instance, at least in the past, MS software cost at least three times as much in some european companies compared to the exchange rate.
    - Finally there are those who steal simply because they don't want to pay for it.
    As far as I am concerned the last category is the only relevant one. And that is far smaller than any software theft estimates that the software industry regularly claims.
    >
    >>
    Here is an example of someone who thinks that their
    work is good enough and valuable enough to stand on
    its own...http://www.fileviewer.com/.
    And I liked it enough that at one company I hadthem
    purchase a site license. And I like it enough thatI
    still remember the company five years after thelast
    time I needed the product.that's fine and it would be very nice if everybody
    would be like you. But that's not the case and you
    even may not be sure if not someone in that company
    took a copy of the software and the licence and now is
    using it for free are even gave it in the "public
    domain". Woulnd't that be sad if the company would
    have to close down someday because just a few people
    are paying for it. Even if it is such a smart
    product?There was a clothing chain that closed down because they claimed that, even after installing anti-theft devices, they were still losing too much money from shop lifters.
    If that is the case why do all of the other companies still exist?
    If your product is good then people will buy it. The successes for that are abundant. The only success stories for copy protection schemes are for the copies that sell those schemes.
    >
    i wonder if you close your door when you leava your
    appartment. I mean, what's wrong with protecting a
    code? It's just the same as protecting the money you
    earn, the furnish in your appartment, ...
    Sorry, when I buy a product then I expect to be able to use it.
    With your analogy I would have to use a code that you provided everytime I wanted to get into and out of my apartment.
    So for any comments, ideas, ... on how to addsome
    more protection i'm very thankfull.You search for "obfuscator".yes, as i wrote in the first posting, i know about
    obfuscator, i'm using it, but it's just very poor
    protection. That's why I'm looking for a smart concept
    to gain a little bit more protection.And if you search for that term in these forums, and read the lengthy posts, you might find some ideas. Which is why I suggested it. (And you might understand why the alternatives are not used.)

  • How to get RTP protocol to Java app?

    Hi,
    I need to work with RTP streams, but I've got problem that I cannot use rtp protocol - if I want to create a new url, MalformedURLexception is raised, here is sample code:
    java.net.URL url;
    try{
         url = new java.net.URL("rtp://www.someweb.cz:8080");
    catch(Exception e){
         System.out.println("Cannot create url - "+e);
    }http and ftp work fine. Can someone explain me what is wrong? JMF is installed on my system...

    MalformedURLexception is raised/*Because your URL is not of proper format*/
    //New mlr should be
    ("rtp://www.someweb.cz:8080//video//1")                    ///Becuse it's windoz //
    !("rtp://www.someweb.cz:8080)
    hmm, damn,
    i hope it works.
    kiss                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

  • How to autopress button in another Java app?

    My mainapp should automatically press a "login" or "yes" button from another application.
    In my mainapp I have:
    private Toolkit toolkit = Toolkit.getDefaultToolkit();
    toolkit = toolkit.addAWTEventListener(new LookForLoginOrYes, AWTEvent.WINDOW_EVENT_MASK);
    public static class LookForLoginOrYes implements AWTEventListener {
       public void eventDispatched (AWTEvent event) {
          System.out.println("in LookFor..."+event.toString()); // this line is printed out!
          WindowEvent windowEvent = (WindowEvent) event;
          if (event.getID() == WindowEvent.WINDOW_OPENED) {
             System.out.println("LFA: WindowEvent.WINDOW_OPENED"); // this line is never printed
             Window window = windowEvent.getWindow();
             if (window instanceof Frame) {
                System.out.println("LFA: " + ((Frame) window).getTitle()); // never printed
    }line with event.toString() displays that my mainapp has no focus anymore of has focus (for this I replaced WINDOW_EVENT_MASK with ~0L).
    Clicking on the titlebar or so of the second app (with the 'yes' button) nothing happens.
    Security settings?

    The Robot class ties into the native interface, but has no concept of the application's components. Therefore, the only way the Robot class could perform this task is if a) you teach it to recognize the button from a screenshot of the desktop or b) you guarantee that the button is in a specific location. The Robot class is the only system-independent way to do this if your applications run in different JVMs. This is because each JVM is pretty much a seperate computer and, beyond network connections, file pipes, etc., each has no concept of the other's existence.
    Are you able to modify both applications' source? If so, I would recommend you handle your situation this way:
    public class AppOne extends JFrame
        public AppOne(...)
            JButton button = new JButton("That Button You Want To Press");
            button.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    thatButtonWasPressed();
        public void thatButtonWasPressed()
            ... // button-press code
        public static void main(String arg[])
            AppOne app = new AppOne(...);
            app.setLocationRelativeTo(null);
            app.setVisible(true);
    public class AppTwo extends JFrame
        public AppTwo(AppOne other_app, ...)
            ... // at the appropriate point, call "other_app.thatButtonWasPressed()"
        public static void main(String arg[])
            AppOne app_one = new AppOne(...);
            AppTwo app_two = new AppTwo(app_one, ...);
            app_one.setLocationRelativeTo(null);
            app_one.setVisible(true);
            app_two.setLocationRelativeTo(null);
            app_two.setVisible(true);
    }In this example, the button is not actually being pressed, but the same effect is generated. I recommend this approach because it cuts out a lot of potential interference. Why deal with the user interface if you don't have to? What you seem to want (and correct me if I'm wrong) is for the application to perform a specific operation on your request. The fact that this operation happens to also occur when a user presses a specific button is irrelevant.
    Is there some reason you need the Swing/AWT system to actually think the button has been pressed? If you can't modify the source code of the one application, that would make sense.

  • Java apps fuzzy on macbook pro retina display

    Anyone else experiencing this?

    PaoloM wrote:
    it seems to be a bug in JDK 7 and not specific only to SQL Developer:
    JDK-8000629 : [macosx] Blurry rendering with Java 7 on Retina display
    I've found mention of this bug in a bug report for the Netbeans IDE and from the information present over there it seems that the blurred text issue should be solved with the latest version of JDK7 (later than 7u40 build b28). Could you please try updating the JDK and see if the issue is solved?
    I am really curious to know if the issue is fixed.
    Updating the JDK fixed the fuzzy rendering Unfortunately it's introduced a new problem where the UI font (not the code editor font) is too big.

  • How to contact Apple in cases where Apps don't provide features they display

    An App names "SB Settings" showed fake images of their product. Just want to know where to report such apps or should we just chargeback the transaction done at Apple Store.

    The 'report a problem' button via your purchase history on your account on your computer's iTunes should work - one of the options on the screen that you are taken to is 'This application does not function as expected', with a text box below for further details about the problem e.g. click on the 'report a problem' button :
    then click on the 'report a problem' text on the app's line :
    and you should get a screen similar to :
    If that process doesn't work (it sometimes takes people to this site on a browser) then use the contact iTunes support link I gave in my first reply.

  • How to make a GUI java portlet?

    how can i make a Gui java portlets with JDeveloper?

    Check out the Portal Development Kit (PDK) available at http://portalstudio.oracle.com/
    Hope this helps,
    Rob

  • How to convert a row into a column with the row headers displayed as column in javaFx?

    How do in convert a row of data into column of data to display as shown below:
    Column1|Column2|Column3|Column4
    C1          | C2          | C3           |  C4
    C5          | C6          | C7           |  C8
    How to convert the above default behavior to as below
    Column1| C1 | C5
    Column2| C2 | C6
    Column3| C3 | C7
    Column4| C4 | C8

    .

Maybe you are looking for

  • Anyone else seeing glitches on Export of Mpeg files?

    I have seen this problem  2 maybe 3 times on CS5.5 but on CS6 (cloud) I have a major problem with this. Export the same sequence from the timeline such as a :30 sec spot and the glitch is in exactly the same place each time.   If I change the mb/s su

  • Error updating selinux

    I am trying to run a yum update for selinux-policy-targeted 2.4.6-327.el5. While running the update, I hit the following error: cp: cannot remove `/etc/selinux/targeted/contexts/files/file_contexts.pre': Permission denied Error in PREIN scriptlet in

  • Workflow with iRecruitment

    Hi All.. There is a requirement to send reminder to Approvers ( Vacancy ). Should we use Workflow ? If Yes.. How ? Please help me understand with clear steps Thanks and Regards Deepak

  • Back up - file system

    This question is on backup. Every time i take backup of file system for app folder(\\Hyperion\AnalyticServices) from my essbase server. Is this the right way backing up of file system.if any of database corroupts, Can i just rplace the app folder wit

  • Signal manipulati​on---help?

    hey, i am trying to simulate a vibration (accl vs time) signal by reading from a spreadsheet with about 15000 data points(time and accl). i am reading the two colomns from the sprdsheet and plotting them on a XY graph in a auto indexed for loop(so th