How can I use JEditorPane in my simplified web system? URJENT!!!!!

Hello friends!
In my client side browser..I would like to display the contents of web pages which are retrieved from the web server.
Does the JEditorpane is useful in this scenario? if so how can i display?
As i accept data in stream from the server..how can i give it to JEditorpane?
Please do reply me ...fastly.

If you want something done fast, then why don't you try reading the API. The API:
a) points your to the Swing tutoral on "Using Text Components" which has a working example
b) shows you 3 ways to load data into the JEditorPane.

Similar Messages

  • How can WLS use JSP pages in a Web Application witth just a JRE [Web Application, WAR, JSP, weblogic.jsp.pageCheckSeconds and JRE]

              How can WLS use JSP pages in a Web Application (either a .war file or a war directory structure) without a java compiler?
              I suspect either the JSP specification is flawed (i.e. it doesn't take account of servers using just a JRE), or BEA's implementation is broken.
              Production servers do not have a JDK installed. They only have a JRE. Therfore a java compiler is not present on the machine that the Web Application is deployed onto.
              On the development machine, when the server is requested to load the JSP it creates a tmpwar directory within the Web Application directory structure. This is then included in the resultant .war file thus:
              D:\war>jar -tf gmi.war
              META-INF/
              META-INF/MANIFEST.MF
              gmiService.jsp
              WEB-INF/
              WEB-INF/classes/
              WEB-INF/classes/com/
              WEB-INF/classes/com/bt/
              WEB-INF/classes/com/bt/gmi/
              WEB-INF/classes/com/bt/gmi/gmiService.class
              WEB-INF/getList.xsl
              WEB-INF/getListByConnection.xsl
              WEB-INF/getListByDistrict.xsl
              WEB-INF/getListByDistrictConnection.xsl
              WEB-INF/lib/
              WEB-INF/source/
              WEB-INF/source/build.bat
              WEB-INF/source/gmiService.java
              WEB-INF/web.xml
              WEB-INF/weblogic.xml
              tmpwar/
              tmpwar/jsp_servlet/
              tmpwar/jsp_servlet/_gmiservice.class
              tmpwar/jsp_servlet/_gmiservice.java
              When deployed on the production server with the web.xml file set to use the following values (note XML stripped):
              weblogic.jsp.pageCheckSeconds
              -1
              weblogic.jsp.precompile
              false
              weblogic.jsp.compileCommand
              javac
              weblogic.jsp.verbose
              true
              weblogic.jsp.packagePrefix
              jsp_servlet
              weblogic.jsp.keepgenerated
              false
              And in the weblogic.properties file:
              weblogic.httpd.webApp.gmi=war/gmi
              I've also tried with the .war file, but that insists on creating another tmpwar directory outside of the .war file.
              Then, although I have set pageCheckSeconds to -1 (don't check and don't recompile) ter production server still attempts to recompile the JSP's:
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: init
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param verbose initialized to: true
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param packagePrefix initialized to: jsp_servlet
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param compileCommand initialized to: javac
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param srcCompiler initialized to weblogic.jspc
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param superclass initialized to null
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param workingDir initialized to: /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param pageCheckSeconds initialized to: -1
              Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: initialization complete
              Mon Sep 25 11:40:12 BST 2000:<I> <WebAppServletContext-gmi> Generated java file: /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java
              Mon Sep 25 11:40:14 BST 2000:<E> <WebAppServletContext-gmi> Compilation of /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java failed: Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
              java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[javac, -classpath, /opt/Solaris_JRE_1.2.1_04/lib/rt.jar:/opt/Solaris_JRE_1.2.1_04/lib/i18n.jar:/opt/Solaris_JRE_1.2.1_04/classes:/var/wls/5.1/weblogic/lib/weblogic510sp4boot.jar:/var/wls/5.1/weblogic/classes/boot:/var/wls/5.1/weblogic/eval/cloudscape/lib/cloudscape.jar:/var/wls/5.1/weblogic/lib/wleorb.jar:/var/wls/5.1/weblogic/lib/wlepool.jar:/var/wls/5.1/weblogic/lib/weblogic510sp4.jar:/var/wls/5.1/weblogic/license:/var/wls/5.1/weblogic/classes:/var/wls/5.1/weblogic/lib/weblogicaux.jar:/opt/wls-servers/gmiServer/weblogic/gmiServer/serverclasses:/opt/wls-servers/gmiServer/weblogic/lotusxsl.jar:/opt/wls-servers/gmiServer/weblogic/xerces.jar:/opt/wls-servers/gmiServer/weblogic/logging.jar::/opt/wls-servers/gmiServer/weblogic/war/gmi/WEB-INF/classes:/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war, -d, /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war, /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java])
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.io.IOException.<init>(Compiled Code)
              at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Compiled Code)
              at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:200)
              at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:187)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:142)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)
              

    The default Java compiler from sun lives in the tools.jar that comes with
              the JDK. Just add that to your set of JARs which are deployed in production
              and you should be fine. No need to install the full JDK - just make the
              tools.jar available to WebLogic.
              Regards
              James
              James Strachan
              =============
              email: [email protected]
              web: http://www.metastuff.com
              "Martin Webb" <[email protected]> wrote in message
              news:[email protected]...
              >
              > How can WLS use JSP pages in a Web Application (either a .war file or a
              war directory structure) without a java compiler?
              >
              > I suspect either the JSP specification is flawed (i.e. it doesn't take
              account of servers using just a JRE), or BEA's implementation is broken.
              >
              > Production servers do not have a JDK installed. They only have a JRE.
              Therfore a java compiler is not present on the machine that the Web
              Application is deployed onto.
              >
              > On the development machine, when the server is requested to load the JSP
              it creates a tmpwar directory within the Web Application directory
              structure. This is then included in the resultant .war file thus:
              >
              > D:\war>jar -tf gmi.war
              > META-INF/
              > META-INF/MANIFEST.MF
              > gmiService.jsp
              > WEB-INF/
              > WEB-INF/classes/
              > WEB-INF/classes/com/
              > WEB-INF/classes/com/bt/
              > WEB-INF/classes/com/bt/gmi/
              > WEB-INF/classes/com/bt/gmi/gmiService.class
              > WEB-INF/getList.xsl
              > WEB-INF/getListByConnection.xsl
              > WEB-INF/getListByDistrict.xsl
              > WEB-INF/getListByDistrictConnection.xsl
              > WEB-INF/lib/
              > WEB-INF/source/
              > WEB-INF/source/build.bat
              > WEB-INF/source/gmiService.java
              > WEB-INF/web.xml
              > WEB-INF/weblogic.xml
              > tmpwar/
              > tmpwar/jsp_servlet/
              > tmpwar/jsp_servlet/_gmiservice.class
              > tmpwar/jsp_servlet/_gmiservice.java
              >
              > When deployed on the production server with the web.xml file set to use
              the following values (note XML stripped):
              >
              > weblogic.jsp.pageCheckSeconds
              > -1
              >
              > weblogic.jsp.precompile
              > false
              >
              > weblogic.jsp.compileCommand
              > javac
              >
              > weblogic.jsp.verbose
              > true
              >
              > weblogic.jsp.packagePrefix
              > jsp_servlet
              >
              > weblogic.jsp.keepgenerated
              > false
              >
              >
              > And in the weblogic.properties file:
              >
              > weblogic.httpd.webApp.gmi=war/gmi
              >
              > I've also tried with the .war file, but that insists on creating another
              tmpwar directory outside of the .war file.
              >
              >
              > Then, although I have set pageCheckSeconds to -1 (don't check and don't
              recompile) ter production server still attempts to recompile the JSP's:
              >
              >
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: init
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              verbose initialized to: true
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              packagePrefix initialized to: jsp_servlet
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              compileCommand initialized to: javac
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              srcCompiler initialized to weblogic.jspc
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              superclass initialized to null
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              workingDir initialized to:
              /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
              pageCheckSeconds initialized to: -1
              > Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp:
              initialization complete
              > Mon Sep 25 11:40:12 BST 2000:<I> <WebAppServletContext-gmi> Generated java
              file:
              /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
              java
              > Mon Sep 25 11:40:14 BST 2000:<E> <WebAppServletContext-gmi> Compilation of
              /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
              java failed: Exception in thread "main" java.lang.NoClassDefFoundError:
              sun/tools/javac/Main
              >
              > java.io.IOException: Compiler failed
              executable.exec([Ljava.lang.String;[javac, -classpath,
              /opt/Solaris_JRE_1.2.1_04/lib/rt.jar:/opt/Solaris_JRE_1.2.1_04/lib/i18n.jar:
              /opt/Solaris_JRE_1.2.1_04/classes:/var/wls/5.1/weblogic/lib/weblogic510sp4bo
              ot.jar:/var/wls/5.1/weblogic/classes/boot:/var/wls/5.1/weblogic/eval/cloudsc
              ape/lib/cloudscape.jar:/var/wls/5.1/weblogic/lib/wleorb.jar:/var/wls/5.1/web
              logic/lib/wlepool.jar:/var/wls/5.1/weblogic/lib/weblogic510sp4.jar:/var/wls/
              5.1/weblogic/license:/var/wls/5.1/weblogic/classes:/var/wls/5.1/weblogic/lib
              /weblogicaux.jar:/opt/wls-servers/gmiServer/weblogic/gmiServer/serverclasses
              :/opt/wls-servers/gmiServer/weblogic/lotusxsl.jar:/opt/wls-servers/gmiServer
              /weblogic/xerces.jar:/opt/wls-servers/gmiServer/weblogic/logging.jar::/opt/w
              ls-servers/gmiServer/weblogic/war/gmi/WEB-INF/classes:/opt/wls-servers/gmiSe
              rver/weblogic/war/gmi/_tmp_war, -d,
              /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war,
              /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
              java])
              > at java.lang.Throwable.fillInStackTrace(Native Method)
              > at java.lang.Throwable.fillInStackTrace(Compiled Code)
              > at java.lang.Throwable.<init>(Compiled Code)
              > at java.lang.Exception.<init>(Compiled Code)
              > at java.io.IOException.<init>(Compiled Code)
              > at
              weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Compiled Code)
              > at
              weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:200)
              > at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
              > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
              > at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:18
              7)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :118)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :142)
              > at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:744)
              > at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:692)
              > at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:251)
              > at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
              > at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              > at weblogic.kernel.ExecuteThread.run(Compiled Code)
              >
              >
              >
              

  • How can I use a SWF as a web request proxy between Javascript and my server?

    I know I can call my server directly from javascript.  However, I want to do this through a non-GUI SWF file.
    I'm fairly new to Flash but have gotten all the CS3 tools from work.
    Does anyone know of any examples on:
    1. how to make a web request from within flash provided the URL, post content, and timeout
    2. how to call a Flash API from javascript asynchronously
    3. how to detect whether the browser being used can support my SWF (I don't want it to prompt to install Flash if they don't have it yet)
    I'm actually hoping someone has already done this and has a sample already built.
    Thanks for any help.
    Kevin

    glkad - I think you misunderstood what I'm after.
    I don't just want to send the browser to another URL.  Here's the flow:
    A. javascript initiates a GET or POST web request through the SWF file providing a timeout
    B. the SWF actually makes the request to the server failing if the timeout is exceeded
    C. the SWF notifies the javascript when the call is complete (or times out) and provides the content returned from the server as a string
    I'm looking for more details regarding your answer #3.  HOW can Idetect if flash is available?  (remember, I'm a newbie at flash )
    Thanks.
    Kevin

  • How can i use the gui of the operating system

    hi
    i am working with the gui and i want to ask how can the gui of the java be like the operating system..
    ex : i want the buttons and the frame be like the windows xp .. not appear as default..

    i read the UIManager and i found more methods that getting the font the dimension but i want that when i drag and drop the code already inherent the gui (the shape of the buttons , frame and tool bar from the operating system)
    ex : i working with windows xp, i want the shape of the gui of the frame that i drag and drop it be like the gui of xp)

  • How can I use Drap and Drop in Linux system?

    I try to use DnD in a item from "explorer" in Linux into my application, but it does atually not work. The same version is work well on Windows. Below is code (3 separated files):
    * FileAndTextTransferHandler.java is used by the 1.4
    * DragFileDemo.java example.
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    class FileAndTextTransferHandler extends TransferHandler {
        private DataFlavor fileFlavor, stringFlavor;
        private TabbedPaneController tpc;
        private JTextArea source;
        private boolean shouldRemove;
        protected String newline = "\n";
        //Start and end position in the source text.
        //We need this information when performing a MOVE
        //in order to remove the dragged text from the source.
        Position p0 = null, p1 = null;
        FileAndTextTransferHandler(TabbedPaneController t) {
           tpc = t;
           fileFlavor = DataFlavor.javaFileListFlavor;
           stringFlavor = DataFlavor.stringFlavor;
        public boolean importData(JComponent c, Transferable t) {
            JTextArea tc;
            if (!canImport(c, t.getTransferDataFlavors())) {
                return false;
            //A real application would load the file in another
            //thread in order to not block the UI.  This step
            //was omitted here to simplify the code.
            try {
                if (hasFileFlavor(t.getTransferDataFlavors())) {
                    String str = null;
                    java.util.List files =
                         (java.util.List)t.getTransferData(fileFlavor);
                    for (int i = 0; i < files.size(); i++) {
                        File file = (File)files.get(i);
                        //Tell the tabbedpane controller to add
                        //a new tab with the name of this file
                        //on the tab.  The text area that will
                        //display the contents of the file is returned.
                        tc = tpc.addTab(file.toString());
                        BufferedReader in = null;
                        try {
                            in = new BufferedReader(new FileReader(file));
                            while ((str = in.readLine()) != null) {
                                tc.append(str + newline);
                        } catch (IOException ioe) {
                            System.out.println(
                              "importData: Unable to read from file " +
                               file.toString());
                        } finally {
                            if (in != null) {
                                try {
                                    in.close();
                                } catch (IOException ioe) {
                                     System.out.println(
                                      "importData: Unable to close file " +
                                       file.toString());
                    return true;
                } else if (hasStringFlavor(t.getTransferDataFlavors())) {
                    tc = (JTextArea)c;
                    if (tc.equals(source) && (tc.getCaretPosition() >= p0.getOffset()) &&
                                             (tc.getCaretPosition() <= p1.getOffset())) {
                        shouldRemove = false;
                        return true;
                    String str = (String)t.getTransferData(stringFlavor);
                    tc.replaceSelection(str);
                    return true;
            } catch (UnsupportedFlavorException ufe) {
                System.out.println("importData: unsupported data flavor");
            } catch (IOException ieo) {
                System.out.println("importData: I/O exception");
            return false;
        protected Transferable createTransferable(JComponent c) {
            source = (JTextArea)c;
            int start = source.getSelectionStart();
            int end = source.getSelectionEnd();
            Document doc = source.getDocument();
            if (start == end) {
                return null;
            try {
                p0 = doc.createPosition(start);
                p1 = doc.createPosition(end);
            } catch (BadLocationException e) {
                System.out.println(
                  "Can't create position - unable to remove text from source.");
            shouldRemove = true;
            String data = source.getSelectedText();
            return new StringSelection(data);
        public int getSourceActions(JComponent c) {
            return COPY_OR_MOVE;
        //Remove the old text if the action is a MOVE.
        //However, we do not allow dropping on top of the selected text,
        //so in that case do nothing.
        protected void exportDone(JComponent c, Transferable data, int action) {
            if (shouldRemove && (action == MOVE)) {
                if ((p0 != null) && (p1 != null) &&
                    (p0.getOffset() != p1.getOffset())) {
                    try {
                        JTextComponent tc = (JTextComponent)c;
                        tc.getDocument().remove(
                           p0.getOffset(), p1.getOffset() - p0.getOffset());
                    } catch (BadLocationException e) {
                        System.out.println("Can't remove text from source.");
            source = null;
        public boolean canImport(JComponent c, DataFlavor[] flavors) {
            if (hasFileFlavor(flavors))   { return true; }
            if (hasStringFlavor(flavors)) { return true; }
            return false;
        private boolean hasFileFlavor(DataFlavor[] flavors) {
            for (int i = 0; i < flavors.length; i++) {
                if (fileFlavor.equals(flavors)) {
    return true;
    return false;
    private boolean hasStringFlavor(DataFlavor[] flavors) {
    for (int i = 0; i < flavors.length; i++) {
    if (stringFlavor.equals(flavors[i])) {
    return true;
    return false;
    * TabbedPaneController.java is used by the 1.4
    * DragFileDemo.java example.
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    * Class that manages area where the contents of
    * files are displayed.  When no files are present,
    * there is a simple JTextArea instructing users
    * to drop a file.  As soon as a file is dropped,
    * a JTabbedPane is placed into the window and
    * each file is displayed under its own tab.
    * When all the files are removed, the JTabbedPane
    * is removed from the window and the simple
    * JTextArea is again displayed.
    public class TabbedPaneController {
        JPanel tabbedPanel = null;
        JTabbedPane tabbedPane;
        JPanel emptyFilePanel = null;
        JTextArea emptyFileArea = null;
        FileAndTextTransferHandler transferHandler;
        boolean noFiles = true;
        String fileSeparator;
        public TabbedPaneController(JTabbedPane tb, JPanel tp) {
            tabbedPane = tb;
            tabbedPanel = tp;
            transferHandler = new FileAndTextTransferHandler(this);
            fileSeparator = System.getProperty("file.separator");
            //The split method in the String class uses
            //regular expressions to define the text used for
            //the split.  The forward slash "\" is a special
            //character and must be escaped.  Some look and feels,
            //such as Microsoft Windows, use the forward slash to
            //delimit the path.
            if ("\\".equals(fileSeparator)) {
                fileSeparator = "\\\\";
            init();
        public JTextArea addTab(String filename) {
            if (noFiles) {
                tabbedPanel.remove(emptyFilePanel);
                tabbedPanel.add(tabbedPane, BorderLayout.CENTER);
                noFiles = false;
            String[] str = filename.split(fileSeparator);
            return makeTextPanel(str[str.length-1], filename);
        //Remove all tabs and their components, then put the default
        //file area back.
        public void clearAll() {
            if (noFiles == false) {
                tabbedPane.removeAll();
                tabbedPanel.remove(tabbedPane);
            init();
        private void init() {
            String defaultText =
                "Select one or more files from the file chooser and drop here...";
            noFiles = true;
            if (emptyFilePanel == null) {
                emptyFileArea = new JTextArea(20,15);
                emptyFileArea.setEditable(false);
                emptyFileArea.setDragEnabled(true);
                emptyFileArea.setTransferHandler(transferHandler);
                emptyFileArea.setMargin(new Insets(5,5,5,5));
                JScrollPane fileScrollPane = new JScrollPane(emptyFileArea);
                emptyFilePanel = new JPanel(new BorderLayout(), false);
                emptyFilePanel.add(fileScrollPane, BorderLayout.CENTER);
            tabbedPanel.add(emptyFilePanel, BorderLayout.CENTER);
            tabbedPanel.repaint();
            emptyFileArea.setText(defaultText);
        protected JTextArea makeTextPanel(String name, String toolTip) {
            JTextArea fileArea = new JTextArea(20,15);
            fileArea.setDragEnabled(true);
            fileArea.setTransferHandler(transferHandler);
            fileArea.setMargin(new Insets(5,5,5,5));
            JScrollPane fileScrollPane = new JScrollPane(fileArea);
            tabbedPane.addTab(name, null, (Component)fileScrollPane, toolTip);
            tabbedPane.setSelectedComponent((Component)fileScrollPane);
            return fileArea;
    * DragFileDemo.java is a 1.4 example that
    * requires the following file:
    *    FileAndTextTransferHandler.java
    *    TabbedPaneController.java
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class DragFileDemo extends JPanel
                              implements ActionListener {
        JTextArea fileArea;
        JFileChooser fc;
        JButton clear;
        TabbedPaneController tpc;
        public DragFileDemo() {
            super(new BorderLayout());
            fc = new JFileChooser();;
            fc.setMultiSelectionEnabled(true);
            fc.setDragEnabled(true);
            fc.setControlButtonsAreShown(false);
            JPanel fcPanel = new JPanel(new BorderLayout());
            fcPanel.add(fc, BorderLayout.CENTER);
            clear = new JButton("Clear All");
            clear.addActionListener(this);
            JPanel buttonPanel = new JPanel(new BorderLayout());
            buttonPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            buttonPanel.add(clear, BorderLayout.LINE_END);
            JPanel upperPanel = new JPanel(new BorderLayout());
            upperPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            upperPanel.add(fcPanel, BorderLayout.CENTER);
            upperPanel.add(buttonPanel, BorderLayout.PAGE_END);
            //The TabbedPaneController manages the panel that
            //contains the tabbed pane.  When there are no files
            //the panel contains a plain text area.  Then, as
            //files are dropped onto the area, the tabbed panel
            //replaces the file area.
            JTabbedPane tabbedPane = new JTabbedPane();
            JPanel tabPanel = new JPanel(new BorderLayout());
            tabPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            tpc = new TabbedPaneController(tabbedPane, tabPanel);
            JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                upperPanel, tabPanel);
            splitPane.setDividerLocation(400);
            splitPane.setPreferredSize(new Dimension(530, 650));
            add(splitPane, BorderLayout.CENTER);
        public void setDefaultButton() {
            getRootPane().setDefaultButton(clear);
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == clear) {
                tpc.clearAll();
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("DragFileDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the menu bar and content pane.
            DragFileDemo demo = new DragFileDemo();
            demo.setOpaque(true); //content panes must be opaque
            frame.setContentPane(demo);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
            demo.setDefaultButton();
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();

    I'm currently using Linux Fedora system.
    Doesn't matter. There's no standard way for D&D on Linux, no single API.
    Every application has its own mechanism which may or may not be compatible with any other.
    Gnome and KDE groups are doing some work to provide a common standard but as you know the Linux zealots are completely opposed to anyone telling them what to do (such as creating standards) and won't in general follow them.

  • How can one use the physical memory of our system rather than virtual memory while running Labview?

    We have a Windows NT system with 2 Gb of physical memory and would like to utilize the RAM fully using Labview. What usually occurs is that Labview uses a tremendous amount of page file space while a majority of the physical memory is unused. Is there a way to configure Labview (or our system) to overcome this problem? It seems that our processes would be much faster if they were mainly using the physical memory. Is it possible to trick the system, by creating a RAM disk and allocating this as virtual memory space?

    > We have a Windows NT system with 2 Gb of physical memory and would
    > like to utilize the RAM fully using Labview. What usually occurs is
    > that Labview uses a tremendous amount of page file space while a
    > majority of the physical memory is unused. Is there a way to
    > configure Labview (or our system) to overcome this problem? It seems
    > that our processes would be much faster if they were mainly using the
    > physical memory. Is it possible to trick the system, by creating a
    > RAM disk and allocating this as virtual memory space?
    LabVIEW the application doesn't know anything about physical versus
    virtual memory. LV asks the OS for general purpose memory and goes
    from there.
    Drivers like DAQ and IMAQ will have a combination of general user
    memory and page lo
    cked physical buffers.
    I'm not up on the details, but this is something that the OS is in
    control of, so that is where you need to look for the solution. One
    of the things to look at is the disk cache. By default, I think that
    NT takes a percentage of the RAM to use for disk cache. With that
    much RAM, this is probably unnecessary and is using too much.
    Similarly, the OS may be attempting to keep the working set size
    to a fraction of the total RAM to reserve space for other things.
    It doesn't make sense to me, but then I don't work for MS.
    Greg McKaskle

  • How can I use File DSN to connect to database?

    Hi,
    I am using ODBC-jdbc driver to connect to the database. It seems that the DSN name is required. How can I use a file DSN instead of system DSN to connect to database? Please help?

    oracle provided jdbc drivers (thin and oci) do not use odbc.
    why would you want to slow things down by sending "round trip" data transfers thru a "jdbc to odbc" and thru "odbc to jdbc" conversion routines.
    It isn't necessary with the oracle provided drivers !!

  • How can i use param in my select query ( see code)

    Hi ,
    I need to use the param instead of hardcoding the value in the select query , when i did that it is working .
    I think the limit of args is only till the end of main and my select query is in a method called Load() .
    How can i use the param in my select query .
    public static void main(String[] args){
    name = args[0];
    class= args[1];
    new Load();
    }//end of main
    public Load()
              try {
                   Class.forName(JDBC_DRIVER);
                   connection = DriverManager.getConnection(DATABASE_URL,"username","pw");
                   statement = connection.createStatement();
                   //First Query : pin and ticket number
                   ResultSet resultSet = statement.executeQuery("SELECT pin , ticketnumber from airport ,year where "+                                                                      "year.year_name= Here i need to use the param (instead of hardcoding) and year.class_year= Here too i need to use param");
    }// end of method Load()Edited by: 1sai on Sep 24, 2008 7:34 AM
    Edited by: 1sai on Sep 24, 2008 7:35 AM

    Might I suggest you change the structure of your program to the following:
    public class Load {
      private Connection conn;
      private PreparedStatement statement;
      public Load(String sql) {
        init(sql);
      protected void init(String sql) throws Exception {
        Class.forName(JDBC_DRIVER);
        conn = DriverManager.getConnection(DATABASE_URL, "username", "pw");
        statement = conn.prepareStatement(sql);
      public ResultSet execute(String p1, String p2) throws Exception {
        statement.setString(1, p1);
        statement.setString(2, p2);
        return statement.executeQuery();
      public void close() throws Exception {
        if (statement != null)
          statement.close();
        statement = null;
        if (conn != null)
          conn.close();
        conn = null;
      public static void main(String[] args) throws Exception {
        String sql = args[0];
        String param1 = args[1];
        String param2 = args[2];
        Load load = new Load(sql);
        ResultSet rs = load.execute(param1, param2);
        while (rs.next())
          System.out.println(rs.get(0));
        rs.close();
        load.close();
    }This allows you to use the same "Load" object for multiple queries with different parameters.
    I do not recommend you actually use the code above in any sort of production application. You should really take a look at Spring Framework along with an ORM tool like Hibernate or Ibatis to simplify your DAO layer.
    Hope this helps,
    David

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How can I use one photo twice in a slideshow

    I am in iPhoto '11 9.4.3 making a slideshow to send to iDVD for my mother-in-laws funeral next Wednesday.
    How can I use this one particular photo of her several times in the slide show.
    I have tried copy/past and that does not seem to work.
    Thanx in advance

    I would just duplicate the picture several times and keep inserting duplicates ...

  • How can i use microsoft word on ipad 2

    how can i use the microsoft application on my ipad 2?

    The Pages app is also compatible with MS Word. Unlike some of the others mentioned, the document is actually stored on the iPad as opposed to 'the clouds'. Again, most of those mentioned are cut down versions of MS Word.
    Stand back and look at this constructively; do you need to regularly access to the document from more than one computer/device without the need to keep amending your document on your computer and sending it to your iPad? If so, Documente to Go etc may be the best choice.

  • How can I use the credit on my account instead of credit card to buy apps?

    I have a gift card credit on my account but when I want to buy an app it takes me to my credit card details. How can I use my credit on my account instead of credit card?

    You shouldn't have to put in a credit card, no, but from time to time the iTunes Store seems for some reason to try to insist on one. If just confirming your mailing address doesn't stop it from complaining, go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • How can i use one iCloud Photostream on 2 devices?

    Due to a bug (or feature) on iOS 8 i can't use the same icloud id on 2 iphones:
    https://discussions.apple.com/thread/6536998
    So how can i use ONE iCloud Photostream then on 2 devices?
    Also, on OSX i can define only one Photostream.
    So, how do you import pictures from 2 streams into iPhoto?
    Familyshare is not usefull as the pictures are not in Original-Filesize!

    Hi ..
    Yes. " iPhone 6 or 6 Plus.  iPad Air 2  or  iPad mini 3"
    Set up and use Apple Pay

Maybe you are looking for

  • All USB drives mount as read only for user

    I have searched a bunch and thee results I find seem to be irrelevant to my situation. Most relate to a single USB media that is a problem and won't read or write. On a new Arch install on a new computer (my third base system install). Running Gnome.

  • HELP!!! I've fallen and I can't get up!

    This is insane-- itunes support has been no help in this matter, so hopefully someone can help me. I woke up on sunday morning to multiple instances of fraud on my itunes account-- most were charged through paypal & they have been very helpful in tak

  • Export comments AND highlighted text?

    I know there are several options for exporting comments associated with highlighted text in Adobe Acrobat Pro, but is there a way to export both the comment AND the highlighted text? Thanks.

  • Repeating Table in Master Pages

    Hi =) I'm having some trouble with a dynamic xml form I'm creating. Inside a page I have a repeating table that allows the user to insert a new row (max 4 rows). All I want is this page to adjust nicely to the size of the repeating table. Since I've

  • How to comple and run and compile javacard program

    how to compile and run javacard program "HelloWorld"