Swing components without using applets

hi there
can i display swing components on the browser without using applets through jsp.
if the answer is yes.please help me by sending a sample code.thanking u.
-radhakrishna

A JSP is compiled into a (server-side, obviously) servlet, which responds to Http requests by constructing a String of HTML/JavaScript etc to send back to the browser which then displays it.
A Swing component is a piece of Java. The only way for such a component to run on the client side is to use either Applets or the new Java WebStart technology (see the JDC), which allows you to run a Java App locally from a Web Browser.
You cannot possible use JSP to view Swing Components, without also using either of the above.

Similar Messages

  • How to add swing components in an applet

    hello friends;
    I encounterd one problem that is I created one applet which I derived from JApplet and now I want to add some swing components to that applet. I added them properly and when I am testing my applet in Appletviewer it is working fine but when I tested it in internet explorer it is not working. Please help me overcome this problem
    Thanks in advance.
    Amit

    IE does not support swing if you do not have the java-plugin installed. Either install that, then IE can display Swing components - or use AWT which can be displayed by IE.
    cheers,
    kelysar

  • Is there any way to display JTree without using applet

    Hi,
    is there any way to display JTree without using applet . Can we display the JTree in a JSP page.
    With Regards,
    Sheema.

    Not a JTree, per se. But there are Javascript solutions out there and there are JSP tag library solutions which use a JTree on the server side to hold and maintain the data and expanded nodes.
    This is one that I've used before, it's pretty good:
    http://www.jenkov.dk/treetag/introduction.tmpl

  • I can't use swing components in my applets

    When I write an applet without any swing components, my browser never has any trouble finding the classes it needs, whether they're classes I've written or classes that came with Java. However, when I try to use swing components it cannot find them, because it is looking in the wrong place:
    On my computer I have a directory called C:\Java, into which I installed my Java Development Kit (so Sun's classes are stored in the default location within that directory, wherever that is), and I store my classes in C:\Java\Files\[path depends on package]. My browser gives an error message along the lines of "Cannot find class JFrame at C:\Java\Files\javax\swing\JFrame.class"; it shouldn't be looking for this non-existent directory, it should find the swing components where it finds, for example, the Applet class and the Graphics class.
    Is there any way I can set the classpath on my browser? Are the swing components stored separately from other classes (I'm using the J2SE v1.3)?
    Thanks in advance.

    Without having complete information, it appears that you are running your applets using the browser's VM. Further, I assume you are using either IE or Netscape Navigator pre-v6. In that case, your browser only supports Java 1.1, and Swing was implemented in Java 1.2. You need to use the Java plug-in in order to use the Swing classes (see the Plug-in forum for more information), or else download the Swing classes from Sun and include them in your CLASSPATH.
    HTH,
    Carl Rapson

  • Capturing the raster of Swing components without actually displaying them?

    My goal is to be able to create an Image/BufferedImage that represents the image of Swing components. Now one solution would be to display the component, take a printscrn of it, and cut the resulting image down so that it only contains the area that the component takes up. However, this requires the component to be displayed to the screen.
    Looking for a solution, I found createImage() in java.awt.Component. I tried that, and got a null image. Going back to the javadocs, I found that the component had to be displayable, which was defined as being visible or packed. I tried inserting the component into a JFrame, packed the frame, and then called createImage, only to get a blank Image. I've also tried displaying the JFrame, calling createImage, and displaying the image, but I've had no luck.
    To display the Images, I've been encapsulating them in ImageIcons and displaying those.
    Any ideas pertaining to a good solution?

    How would I go about doing that? I'm looking through
    the API, but I can't find anything relevant.If you direcytly want to create Image object .. then check.. this... and see my last posting of Brio.java
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=711032
    Note: use setVisible(true);
    before creating buffer = createImage(...) else U will get null Image..
    U can also make a BufferedImage like..
    BufferedImage buffer = new BufferedImage(200, 200, BufferedImage.TYPE_3BYTE_BGR);
    Graphics g = buffer.getGraphics();
    g.setColor(new Color(255, 0, 255));
    g.drawImage(img, x, y, null);
    g.fillRect(200,200);
    g.dispose();

  • Not getting swing components when the applet reloads

    I am facing one problem that is related to reloading of swing components. I Have a JPanel inside JApplet which contains some swing components and a button to launch the same JPanel again in the JApplet. When I click on the button the JPanel should get added in the JApplet once again below the upper JPanel. But new JPanel is not getting displayed although the reference of the new JPanel is created.

    My guess is that you haven't added your swing components to the right place. Are you adding them to the contentpane?

  • Playing sound files without using Applets

    Please Help me !
    The code below shows an error " Cannot resolve symbol AudioClip"
    What changes should be made??
    import javax.swing.*;
    import java.net.*;
    import javax.sound.sampled.*;
    import java.applet.AudioClip.*;
    public static void main(String args[]) {
              AudioClip sound;
    sound=JApplet.newAudioClip(new URL("file://C:\\jdk1.3\\bin\\Butfl_g.wav"));
         sound.play();
    }

    Also, the file protocol has 3. not 2 slashes."file://C:\\jdk1.3\\bin\\Butfl_g.wav"should be"file:///C:\\jdk1.3\\bin\\Butfl_g.wav"db

  • Playing sound file without using Applet

    Please Help me !
    The code below shows an error " Cannot resolve symbol AudioClip"
    What changes should be made??
    import javax.swing.*;
    import java.net.*;
    import javax.sound.sampled.*;
    import java.applet.AudioClip.*;
    public static void main(String args[]) {
              AudioClip sound;
    sound=JApplet.newAudioClip(new URL("file://C:\\jdk1.3\\bin\\Butfl_g.wav"));
         sound.play();
    }

    Sorry!Apology accepted.
    I was in need of finding error as quickly as possible.
    Thats why I tried to post it in here.No excuse for cross posting.
    Please don't do it again.
    db

  • Without using applets geting the output into a javascript variable

    Hi,
    I'm not using executeCommand applets in my webpage,but with the url
    i'm running the transaction. I'm passing the url to iframe as a <b>src</b> in the same page itself. like
    <b>document.getElementById("<iframe>").src="http://localhost/Lighthammer/Runner?Transaction=<Transaction_Name>&<Input_params>=<value>&OutputParameter=*"</b>. It will take 10 seconds to execute the transaction and load into the iframe.
    So I'm giving the
    <b>SetTimeout("alert(document.getElementById('<iframe>').docuemnt.body.innerHTML",10000);</b>
    In the iframe i'm able to see the output as "<u>oktransaction executed</u>" in <u>xml format</u>.
    But in the alert I'm not able to see the same content. <i>In the alert I'm able to see</i>
    <u><iframe id="<id of iframe>" src="<Which i set in the script>"></iframe></u>
    Help me to get the OutputParameter value into a javascript variable.

    Rakesh,
    A couple of observations:
    1.  Why are you calling Runner directly?  You should be using an XacuteQuery template, and reference "/Lighthammer/Illuminator?QueryTemplate=Folder/TRX" syntax when changing the URL in the iFrame.
    2.  You are also using "localhost" which is not portable and may also be causing your problem since your parent page will be based upon the server path, whereas you are forcing the browser to load localhost content into the iFrame (which unless you are physically sitting on the xMII server itself will never work).
    Regards,
    Jeremy Good

  • Call jsp function in javascript without using Applet

    anyone knows how to call jsp function in javascript .
    just as follows:
    <%!
    public string jspcall()
    return new String("just a example");
    %>
    <script language="javascript">
    <!--
    temp = jspcall();
    //->
    </script>
    it's desn't work.
    any suggestion will help!

    it's was not able to call a jsp function in javascript.
    jsp function was on server site while javascript normally on the client site.

  • How can I learn "Drag and Drop" with Swing components?

    Hello,
    Im using swing components, so using paint() to draw a "drag icon" doesnt seem acceptable. Im basically trying to move a JPanel image to be dragged/dropped over another JPanel in the same program/applet.
    I looked at Sun's Java Tutorial for information on doing drag and drop, but there was no trail completed yet.
    Does anyone know of any good resources to learn? Or can at least give me a general idea of how to do drag and drop?

    Did you see this?
    http://java.sun.com/docs/books/tutorial/dnd/index.html
    http://java.sun.com/docs/books/tutorial/reallybigindex.html

  • Can i simulate a Resistance,Capacitor and transistor without using hardwarekit

    I am beginner and my professor said to me "i have to simulate a full wave rectifier and an AMPLIFIER which is using a transistor".
    how can i simulate these components without using hardwarekit and any other program
    please help me!!! this is for my thesis.

    LabVIEW offers you many mathematical functions that you can use to simulate the behavior of an electronic component. Most of the functions you need are directly accessible from the Numeric palette. For example a full wave rectifier can be simulated (as a first pass) using the Absolute Value primitive. A half wave rectifier using the Max-Min function in the Comparison palette. A diode characterisitic can be simulated using the exponential (or logarithm) function (Numeric>>Logarithm) to simulate the I <--> V transfer characterisitic and so on.
    So looking at the charactersitics of your component in the datasheet, you can reproduce the behavior by building a model that reproduces the transfer functions shown in the datasheet. A transistor will be a little more
    complicated and also include current <--> voltage conversion (simulating a resistance) but in your simulation it is simply a "gain" (multiplication).
    Goog luck but first of all ... have fun.

  • Swing - components

    is there any method called "setToolTipText(string)" in swing.
    if so in which class
    and with which components it can be used

    Any class that inherets from javax.swing.JComponent gets that method.
    It's commonly used for JButtons and such but just about all swing components can use that method.

  • Catching events on Desktop , without using any AWT or Swing components.

    How can I catch events(for eg: mouse clicks) on the Desktop? I do not want to use any AWT or Swing components in my application.
    Also, i want to get events even some other java/non-java application windows are visible on desktop, as long as my application is running.

    Myrequirement is to capture all AWT events, regardless of on which component its being happened.
    I mean I have to capture events outside the current running application (on desktop and any other java/no-java appliation windows also).
    I couldn't find any other forum which discusses about event handling.
    This is part of my app. other end extensively uses awt.

  • Swing components in applet not working in web browser

    Hi Guys,
    I've created an applet which makes use of some swing components, but unfortunately, not all of them function properly in my web browser (internet explorer or Mozilla Firefox). Its mainly the buttons; the last buttons works and displays the correct file within the broswer, but the first 5 buttons do not work...
    any help please on how I can sort this problem out?
    Heres the code for my applet:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    public class MainAppWindow extends JApplet
    int gapBetweenButtons = 5;
    final JPanel displayPanel = new JPanel(new BorderLayout());
    public void init()
       //Panel for overall display in applet window.
       JPanel mainPanel = new JPanel(new BorderLayout());
       mainPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/smalllogo2.gif"))),BorderLayout.NORTH);
       //sub mainPanel which holds all mainPanels together.
       JPanel holdingPanel = new JPanel(new BorderLayout());
       //Panel for displaying all slide show and applications in.
       displayPanel.setBackground(Color.white);
       displayPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/IntroPage.jpg"))),BorderLayout.CENTER);
       displayPanel.setPreferredSize(new Dimension(590,400));
       JPanel buttonPanel = new JPanel(new GridLayout(6,1,0,gapBetweenButtons));
       buttonPanel.setBackground(Color.white);
       JButton button1 = new JButton("User guide");
       button1.addActionListener(
         new ActionListener() {
              public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll(); // If there are any components in the mainPanel, remove them and then add label
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/UserGuide.jpg")));
                   displayPanel.revalidate(); // Validates displayPanel to allow changes to occur onto it, allowing to add different number images/applicaions to it.
       JButton button2 = new JButton("What is a Stack?");
       button2.addActionListener(
       new ActionListener() {
               public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/WhatIsAStack.jpg")));
                   displayPanel.revalidate();
       JButton button3 = new JButton("STACK(ADT)");
       button3.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StackADT.jpg")));
                   displayPanel.revalidate();
       JButton button4 = new JButton("Stacks in the Real World");
       button4.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StacksInTheRealWorld.jpg")));
                   displayPanel.revalidate();
       JButton button5 = new JButton("DEMONSTRATION");
       button5.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                 if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                 Demonstration app = new Demonstration();
                 JPanel appPanel = app.createComponents();//gets the created components from Demonstration application.
                 appPanel.setBackground(Color.pink);
               displayPanel.add(appPanel);
               displayPanel.revalidate();
       JButton button6 = new JButton("Towers Of Hanoi");
       button6.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                     if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                     TowerOfHanoi app = new TowerOfHanoi();
                     JPanel appPanel = app.createComponents();//gets the created components from Towers of Hanoi
                     JPanel mainPanel = new JPanel();//panel used to centralise the application in center
                     mainPanel.add(appPanel);
                     mainPanel.setBackground(Color.pink); //sets mainPanel's background color for 'Towers Of Hanoi'
                     displayPanel.add(mainPanel);
                     displayPanel.revalidate();
       //adding buttons to the buttonPanel.
       buttonPanel.add(button1);
       buttonPanel.add(button2);
       buttonPanel.add(button3);
       buttonPanel.add(button4);
       buttonPanel.add(button5);
       buttonPanel.add(button6);
       JPanel p = new JPanel(); // Used so that the buttons maintain their default shape
       p.setBackground(Color.white);
       p.add(buttonPanel);
       holdingPanel.add(p,BorderLayout.WEST);
       holdingPanel.add(displayPanel,BorderLayout.CENTER);
       //Positioning of holdingPanel in mainPanel.
       mainPanel.add(holdingPanel,BorderLayout.CENTER);
       //indent mainPanel so that its not touching the applet window frame.
       mainPanel.setBorder(BorderFactory.createEmptyBorder(10,20,10,20));
       mainPanel.setBackground(Color.white);
       mainPanel.setPreferredSize(new Dimension(850,600)); //size of applet window
       mainPanel.setOpaque(false); // Needed for Applet
       this.setContentPane(mainPanel);
    }

    Thanks for the response. I don't quite understand what you're talking about though. I have, in my humble knowledge, done nothing with packages. I have put the applet class (WiaRekenToolActiz.class is the applet class) in the jar file wia_actiz_archive.jar. From what I read on the tutorial, java looks for the applet class in all the jar files specified. Since I put my CODEBASE as the main url, I thought it baiscally didn't matter where you out the html file.
    I shall include the complete html page complete with applet tag to perhaps illuminate a bit more what I mean...
    <html>
    <head>
    <title>Wia Rekenmodule hello!</title>
    </head>
    <body bgcolor="#C0C0C0">
    <applet
    CODEBASE= "http://www.creativemathsolutions.nl/test"
    ARCHIVE= "Actiz/wia_actiz_archive.jar, Generic/wia_archive.jar"
    CODE="WiaRekenToolActiz.class" 
    WIDTH=915 HEIGHT=555
    >
    <PARAM NAME = naam VALUE = "Piet Janssen">
    <PARAM NAME = gebdag VALUE = "01">
    <PARAM NAME = gebmaand VALUE = "06">
    <PARAM NAME = gebjaar VALUE = "1970">
    <PARAM NAME = geslacht VALUE = "man">
    <PARAM NAME = dienstjaren VALUE = "10">
    <PARAM NAME = salaris VALUE = "56500">
    <PARAM NAME = deeltijdpercentage VALUE = "100">
    <PARAM NAME = accountnaam VALUE = "Zorginstelling 'De Zonnebloem'">
    </applet>
    </body>
    </html>

Maybe you are looking for

  • Not allowing to enter Change-Order Screen

    The moment the order no. is typed in IW32 and you enter it, system throws the error message; Inconsistent data: Order 5000000363 29.12.2002, duplicate entry O 0090 It gives the following error; Diagnosis Processing had to be canceled due to inconsist

  • IPhone 5 without purchased ringtones

    My new iPhone 5 doesn't have the ringtones previously purchased from iTunes afer syncing up with iTunes 6. iTunes on my MacBook Pro doesn't even have a ringtone or tone tab to select to sync with. They also do not show up on my iTunes app on my phone

  • Subtitles run 17-18 seconds ahead of the audio

    Ever since the "improvement" earlier this year with the truly horrible "NEW" BT Vision software update (was it in July?) I've been having problems with subtitled programs - my wife needs the subtitles. On RECORDED programs many times  the subtitles s

  • Aperture 3.0.2 always importing

    Since I updated to Aperture 3.0.2, the spinning "importing" indicator always show, even when I'm not importing anything. I opened the Activity Window to see what was going on, but it's blank. Anyone know what's going on and how to fix it? And, sadly,

  • House of cards 3. Staffel, 6. Folge

    Weiss jemand, warum die 6. Folge nicht zum Abruf angeboten wird? Eigentlich sollte sie seit Freitag zur Verfügung stehen...