How to write a browser independent code in java?

Hi ,
Should I use swing code to achieve browser independency ? or will HTML help in a better way?
thnx and rgds hs

It's one of those Microsoft vs. Sun things. Microsoft hasn't implemented java swing, instead they have their own package called AFC, which only exists on internet explorer (and which I found it next to impossible to get documentation for).
So you are stuck with the really fairly crappy java.awt level classes.

Similar Messages

  • How to invoke safari browser through code?

    how to invoke safari browser through code?

    Hi Sam,
    Please check if the articles below can be help:
    http://www.bizsupportonline.net/browserforms/programmatically-submit-infopath-form-sharepoint-send-email-close-form.htm
    http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How to write certain file On jCD through Java

    hi all,
    I got big problem in java , would anybody tell me how to write certain file onto CD through java. Is there any API available for this.
    Thanks in advance
    --Harish                                                                                                                                                                                                                                                                                                                                                               

    You might check this thread.
    http://forum.java.sun.com/thread.jspa?threadID=212748&tstart=90

  • How to write uninterruptable blocks of code in the RUN method of a THREAD?

    Hello people,
    It is better I explain my problem with example code
    public class MyThreadClass implements Runnable
    //some definitions
    public void run()
    //some codes
    /*HERE I WANT TO WRITE A CODE WHICH WILL BE RUN AS ORDINARILY
    FROM BEGINING TO THE END WITOUT ANY INTERRUPT*/
    //some codes
    Please help, if you can.
    Thanks in advance
    Tamer

    You can't write a block of uninterruptable code in Java.

  • How to install new fonts using code in java?

    Hi,
    How to install font in a system using java, provided i know the font file's address. Is there any specific class/method available for this purpose? Copying the file to windows/font directory will work for windows, but I think it wont be generic to all operating system. So is there anyway to install a font using code?
    I also want to know how to make the font available only until my application window is open, It must be available to all other external applications like photoshop, word etc., When I close my window it must un-install automatically or be made not available to other applications. Any suggestions? Please do help! Thanks in advance...

    I have already tried the above, But the font created using input stream is available only to my application* and is not viewable in photoshop.*. I realize this. Like I said, I know of no method that will register/deregister the font with the system. You'll have to create your own method that takes the operating system into account.
    String os = System.getPropery("os.name");
    if(os.equals("Windows Vista")) {
    }else if(os.equals("Windows XP")) {
    }else if(os.equals("Windows NT")) {
    }else if(os.equals("Solaris")) {
    AIX
    Digital Unix
    FreeBSD
    HP UX
    Irix
    Linux
    Mac OS
    Mac OS X
    MPE/iX
    Netware 4.11
    OS/2
    Solaris
    Windows 2000
    Windows 95
    Windows 98
    Windows NT
    Windows Vista
    Windows XPYou'll need the standard font directory for each system. I think all the window ones are C:\Windows\Font\ . Each OS probably has its own little quark (like having several font directories or throwing different security exceptions). Undoubtly it's going to require some research and a bit of trial and error. You can probably work some magic with Runtime.exec(...) as well.
    The alternative would be to google for some libraries that offer similar functionality, or promt the user for the system's font directory and save the location of the directory in a file somewhere for future use (so the user dosen't have to specify the font directory everytime he/she starts up the application).

  • How to Write data in Excel File using java

    Hi
    can anybody help me to write data in excel file
    using java code
    Thankx In Advance

    How much are you willing to pay for that?
    If you want it for free, http://jexcelapi.sourceforge.net/

  • How to incorporate the C/C++ code in Java?

    Guys,
    Does any one here knows about in incorporating the C/C++ code in java?
    Or know about to call the C/C++ code in java?
    Guys, please impart your knowledge to me...
    Thanks,
    Mercy

    JNI is built right into the JVM - in fact some of the most fundamental of the library classes use it to get access to the operating system.
    You package your C and C++ into a DLL (windows) or shared library (unix) to which you connect with a System.loadLibrary() call.
    To create the hooks, you declare special methods native. Then you run the classes with native methods through the javah comand to generated C headers declaring the methods to which the java connecfs.

  • How to write JMS provider independent source code

    As the subject says i need to write a client/server which is independent of the JMS provider.
    I dont know how to do that, can any 1 help me on this?
    or
    Is there any place where i can look for it.
    Thank you

    refer http://www-128.ibm.com/developerworks/java/library/j-jmsvendor/

  • How to write the pl/sql code for this scenario

    Hi,
    Here is the data in a Table with below colums
    id firstname lastname code
    1 scott higgins 001
    2 Mike Ferrari 001
    3 Tom scottsdale 002
    4 Nick pasquale 003
    1 scott higgins 004
    I want to trap the following exceptions into an error table using pl/sql
    1. same person having multiple code
    example
    id first last Code
    1 scott higgins 001
    1 scott higgins 004
    2. Multiple persons having same code
    id first last Code
    1 scott higgins 001
    2 Mike Ferrari 001
    Could you please help me how to capture the exceptions above using pl/sql
    and what will be the structure of error table. it should capture eff date & end date

    or using analytic functions like this:
    select id, fname, lname, code from (
    with t as(
        select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
        union all
        select 2 id,'Mike ' fname, 'Ferrari' lname,  001  code from dual
        union all
        select 3 id,'Tom' fname, 'scottsdale' lname, 002  code from dual
        union all
        select 4 id,'Nick' fname, 'pasquale' lname, 003  code from dual
        union all
        select 5 id,'scott' fname, 'higgins' lname, 004  code from dual
        select t.*, count(*) over (partition by fname) row_count from t)
    where row_count > 1;
    select id, fname, lname, code from (
    with t as(
        select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
        union all
        select 2 id,'Mike ' fname, 'Ferrari' lname,  001  code from dual
        union all
        select 3 id,'Tom' fname, 'scottsdale' lname, 002  code from dual
        union all
        select 4 id,'Nick' fname, 'pasquale' lname, 003  code from dual
        union all
        select 5 id,'scott' fname, 'higgins' lname, 004  code from dual
        select t.*, count(*) over (partition by code) row_count from t)
    where row_count > 1;

  • How to start a browser from within a java program?

    I want to make a help file for my java program and want to run the browser from the menu of my program.
    How can I start my browser from my program?
    A small code will be helpful.
    Thanks.
    Niteen

    This should work on Windows without having to know where the browser is located. See http://www.javaworld.com/javaworld/javatips/jw-javatip66.html for more details
      public static void viewHtml(URL url, boolean fixHtmlExtension){
          String cmd = "rundll32 url.dll,FileProtocolHandler " + url.toExternalForm();
          if (fixHtmlExtension){
            //There is a bug in rundll32. For http requests, it doesn't like .html or .htm extensions,
            //but replacing the 'm' with '%6D' works. 
            //This fix is not needed for file requests.
            if (cmd.endsWith(".htm")){
              cmd = cmd.substring(0,cmd.length()-1) + "%6D";
            else if (cmd.endsWith(".html")){
              cmd = cmd.substring(0,cmd.length()-2) + "%6Dl";
          Process process = Runtime.getRuntime().exec(cmd);
          try{
            process.waitFor();
          catch(InterruptedException e){

  • How to run 64-bit native code with Java Web Start

    This question has probably been asked many times, but I couldn't find anything in my searches.
    How can I get Java Web Start on a Solaris client (Solaris 10 in this case, with JRE 1.5) to run a java application that includes a 64-bit native code library? The application downloads fine, including the jar file that has the native shared object, but when the native library is loaded by the java application, I get a "wrong ELF class: ELFCLASS64" error.
    I assume that is because Web Start is invoking the 32-bit java VM, which can't load a 64-bit library. I tried configuring Java Web Start to use the 64-bit VM (by setting the path to java to ".../jre/bin/sparcv9/java" in the javaws console) but then I get an error that says "Can't load library: .../jre/lib/sparcv9/libdeploy.so".
    Does Java Web Start support 64-bit native code, and if so, what do I need to do differently?
    Thanks.

    No it can't. On the Sun download page of the JRE it says that 64 Bit systems need to use the 32 Bit JRE to execute Plugins - this might be the same for Web Start apps.

  • How to write run.bat files

    Can anyone tell me how to write run.bat files to run java classes. Currently my run.bat file has the following two lines,
    c:\j2sdk1.4.1_02\bin\javac.exe *.java
    c:\j2sdk1.4.1_02\bin\java.exe questionnair
    But the class is not executed. Thanks in advance.

    you'll have to provide more details.
    Firstly, which package is the class a part of? and secondly, where on the filesystem is the root of the package?
    You might also benifit from placing the c:\j2sdk1.4.1_02\bin\ into the classpath.
    On a rainy day, check out the ANT tool, it will take care of all that crapola for you.
    newio

  • How to write javascript in java class method

    Hi,
    any one please resolved this,
    i want to write javascript window closing code into java class method, in that method i want to write javascript code & wanted to call in jsf page on commandButton action event,
    my code is below but it is not working properly
    public void closeWindowClicked(ActionEvent event) {
              try
         FacesContext facesContext = FacesContext.getCurrentInstance();
         String javaScriptText = "window.close();";
         // Add the Javascript to the rendered page's header for immediate execution
         AddResource addResource = AddResourceFactory.getInstance(facesContext);
         addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javaScriptText);
    catch(Exception e)
         System.out.println(""+e);
    for calling into jsf code is below
    <h:commandButton action="#{parentBean.closeWindowClicked}" value="OK" />
    /*Note- i want to closed the window by caling method contain javascript only, i don't want any ajax code in method */
    please any one can resolved this.
    Thanks

    /*Note- i want to closed the window by caling method contain javascript only, i
    don't want any ajax code in method */ When the user presses your button, do your business logic and then send them to a page containing the following (note: untested code ahead):
    <html>
    <head>
        function onLoadHandler()
            window.close();
    </head>
    <body onload="onLoadHandler();">
        <p>Window closing....</p>
    </body>
    </html>

  • How do i double buffer this code (URGENT)

    i make an image move when user presses the arrow buttons but the moving image flickers how do i prevent that
    the code:
    import java.awt.*;
    import java.io.*;
    public class KenshinGame extends Frame{
    MoveImages mi = new MoveImages();
    int x = 355;
    int y = 10;
    int spaceCount = 0;
    public KenshinGame () {
         add ("Center", mi);
    public boolean handleEvent (Event evt){
         if (evt.id == Event.WINDOW_DESTROY){
         System.exit(0);
         return super.handleEvent(evt);
    public boolean keyDown(Event evt, int key){
    if (key == Event.LEFT) {
         //System.out.println (x);
         if (y > 125 && y <170 && x > 65){
         x = x - 10;
         mi.move(x, y);
         else if (y < 650&& y > 620 && x > 110){
         x = x - 10;
         mi.move(x, y);
    else if (key == Event.RIGHT) {
         //System.out.println (x);
         if (y > 125 && y <170 && x < 675){
         x = x + 10;
         mi.move(x, y);
         else if (y < 650&& y > 620 && x < 640){
         x = x + 10;
         mi.move(x, y);
    else if (key == Event.UP) {
         //System.out.println (y);
         if (y > 10 && x == 355){
         y = y - 10;
         mi.move(x, y);
         else if (y > 120 && x > 320 && x < 390){
         y = y - 10;
         mi.move(x, y);
         else if (x < 130 && x > 110 && y > 120 && y < 170){
         y = y - 10;
         mi.move(x, y);
         else if (x > 475 && x < 515 && y > 110 && y < 170){
         y = y - 10;
         mi.move(x, y);
         else if (x > 625 && x < 655 && y > 110 && y < 170){
         y = y - 10;
         mi.move(x, y);
         else if (x < 130 && x > 110 && y > 605 && y < 640){
         y = y - 10;
         mi.move(x, y);
    else if (key == Event.DOWN) {
         if (x > 320 && x < 390 && y < 670){
         y = y + 10;
         mi.move(x, y);
         else if (x < 130 && x > 110 && y > 100 && y < 170){
         y = y + 10;
         mi.move(x, y);
         else if (x > 475 && x < 515 && y > 90 && y < 170){
         y = y + 10;
         mi.move(x, y);
         else if (x > 625 && x < 655 && y > 90 && y < 170){
         y = y + 10;
         mi.move(x, y);
         else if (x < 130 && x > 110 && y > 595 && y < 640){
         y = y + 10;
         mi.move(x, y);
         else if (y > 660){
         x = 615;
         y = 390;
         mi.move (x, y);
    return true;
    public static void main(String args[]) {
         Frame f = new KenshinGame();
         f.resize (760, 740);
         f.show();
         f.setTitle ("Gmae: Level 1");
    class MoveImages extends Canvas {
    int x = 355;
    int y = 10;
    int w = 10;
    int h = 20;
    String mapLoc = new String ("c:\\My Documents\\My Pictures\\liotto.gif");
    String maincLoc = new String ("c:\\My Documents\\My Pictures\\rstand.gif");
    Image map = Toolkit.getDefaultToolkit().getImage(mapLoc);
    Image mainc = Toolkit.getDefaultToolkit().getImage (maincLoc);
    public void paint (Graphics g){
         MediaTracker tracker = new MediaTracker(this);
         tracker.addImage(map, 0);
         g.drawImage (map, 0, 0, this);
         try {     
         tracker.waitForAll();
         catch (InterruptedException e) {
         g.drawImage (mainc, x, y, this);
    public void move(int xCo, int yCo){
         x = xCo;
         y = yCo;
         repaint();
    public void update (Graphics g){
         paint (g);
    }

    i havent changed the main class but i did change the canvas because i have figured out how to use double buffering any suggestions how i can fix this instead:
    class MoveImages extends Canvas {
    int x = 355;
    int y = 10;
    String di = "stand";
    String mapLoc = new String ("c:\\My Documents\\My Pictures\\liotto.gif");
    Image map = Toolkit.getDefaultToolkit().getImage(mapLoc);
    Image stand = Toolkit.getDefaultToolkit().getImage("c:\\My Documents\\My Pictures\\rstand.gif");
    Image walka = Toolkit.getDefaultToolkit().getImage("c:\\My Documents\\My Pictures\\rwalka.gif");
    Image walkt = Toolkit.getDefaultToolkit().getImage("c:\\My Documents\\My Pictures\\rwalkt.gif");
    Image walkl = Toolkit.getDefaultToolkit().getImage("c:\\My Documents\\My Pictures\\rwalkl.gif");
    Image walkr = Toolkit.getDefaultToolkit().getImage("c:\\My Documents\\My Pictures\\rwalkr.gif");
    int w = 760;
    int h = 740;
    Image offscreen ;
    Graphics og;
    public MoveImages (){
    public void paint (Graphics g){
         g.drawImage (map, 0, 0, this);
         if (di.equals ("stand")){
         g.drawImage (walka, x, y, this);
         g.drawImage (walkt, x, y, this);
         g.drawImage (walkl, x, y, this);
         g.drawImage (walkr, x, y, this);
         g.drawImage (stand, x, y, this);
         else if (di.equals ("walka")){
         g.drawImage (walkt, x, y, this);
         g.drawImage (walkl, x, y, this);
         g.drawImage (walkr, x, y, this);
         g.drawImage (stand, x, y, this);
         g.drawImage (walka, x, y, this);
         else if (di.equals ("walkt")){
         g.drawImage (walkl, x, y, this);
         g.drawImage (walkr, x, y, this);
         g.drawImage (stand, x, y, this);
         g.drawImage (walka, x, y, this);
         g.drawImage (walkt, x, y, this);
         else if (di.equals ("walkl")){
         g.drawImage (walkt, x, y, this);
         g.drawImage (walkr, x, y, this);
         g.drawImage (stand, x, y, this);
         g.drawImage (walka, x, y, this);
         g.drawImage (walkl, x, y, this);
         else if (di.equals ("walkr")){
         g.drawImage (walkt, x, y, this);
         g.drawImage (walkl, x, y, this);
         g.drawImage (stand, x, y, this);
         g.drawImage (walka, x, y, this);
         g.drawImage (walkr, x, y, this);
    public void move(int xCo, int yCo, String direction){
         di = direction;
         x = xCo;
         y = yCo;
         repaint();
    public void addNotify(){
         super.addNotify();
    public void update (Graphics g){
         if (offscreen == null){
         offscreen = createImage (w, h);
    og = offscreen.getGraphics ();
         paint (og);
         g.drawImage (offscreen, 0, 0, this);
    }

Maybe you are looking for

  • Error while Enabling Active Data Cache Clustering Services: error 1753

    I have installed the Oracle BAM with Enterprise link.All the installation was successful.But while Enabling Active Data Cache Clustering Services using the following command: cluster.exe restype "Oracle Business Activity Monitoring Active Data Cache"

  • BAPI_PO_CHANGE failing

    I am using BAPI_PO_CHANGE to add line item to the purchase order. This PO is taking reference from the SO of same company code. when i run this BAPI it gives me the following message: PO Changes Failed due to following reasons                  Changi

  • Can I make my iphoto library a screensaver that rotates repeatedly selecting randomly

    I understand how to make one or more pictures my desktop picture.  But what I would like to do is have the pictures in my IPhoto library selected randomly be a screensaver that rotates across the screen when I am not using my computer.  How can I do

  • 2106 and RSA RADIUS

    I have a 2106 wireless controller set up along with a 1252 access point. I am able to authenticate to the AP via WPA-PSK without issue. However when I configure authentication to use our RSA RADIUS server it fails with several error messages. I am co

  • Added a signature, all comments got erased!

    I added a signature to my eBook in Acrobat 11.0.03 for Mac. The eBook had about 20-30 hours of work in terms of comments. Adding a signature and saving the document on top of the original caused all the comments to be erased! This is a pretty ridicul