Java - system clipboard problem

I'm trying to put text from a java program to the system clipboard (OS) and I can't make it work.
I've included a small code example in this post.
import java.awt.datatransfer.*;
import java.awt.*;
import java.awt.Toolkit.*;
class ClipTest{
public static void main(String[] args){
new ClipTest();
public ClipTest(){
StringSelection clip = new StringSelection("hello");
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(clip,clip);
System.exit(0);
After running the program I would expect to have "hello" on my System clipboard. But I don't. Nothing has been transfered to the clipboard.
I'm running java1.3.1 on IRIX and I have tryed Linux as well.
Am I doing something wrong here? Please enlighten me.

That's a thought. but take this code example though:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyTextArea extends JTextArea implements ActionListener{
JTextArea m_txt;
JPopupMenu m_menu;
public MyTextArea(){
super();
m_txt=this;
addMouseListener(new RightMouseListener());
m_menu = new JPopupMenu("Menu");
JMenu item = new JMenu("Edit");
m_menu.add(item);
JMenuItem item1 = new JMenuItem("Copy");
item1.addActionListener(this);
item1.setActionCommand("copy");
item.add(item1);
class RightMouseListener extends MouseAdapter{
public void mouseClicked(MouseEvent e){
if(e.getModifiers()==InputEvent.BUTTON3_MASK){
m_menu.show(m_txt, e.getX(),e.getY() );
public void actionPerformed(ActionEvent e){
if (e.getActionCommand().equals("copy")) {
copy();
If you use this component in a dialog or something, type some text in it, make a selection, righclick and choose copy from the edit menu, I get the same result, and I guess it will work at your Windows platform?

Similar Messages

  • Java System Clipboard error implementing inhereted lostOwnership procedure

    I am trying to get a string from the system clipboard manipulate it then put the manipulated string back on the system clipboard. I'm fairly certain i have the accessing the clipboard correct, but i can't figure out an error i'm getting with part of it.
    Error Message:
    Syntax error on token "}", delete this token
    It refers to the "}" that closes the scope of the lostOwnership procedure, which has to be implemented by the class because it is inherited from the "implements ClipboardOwner", but is not implemented by it.
    Code:
    public class Programming12 implements ClipboardOwner{
         private static JFrame frame  = new JFrame("HTS Programming 12");
         private static JTextArea ta;
         private static JButton start = new JButton("START");
         private ClipboardOwner co = this;//must do this because need to use "this" as the ClipboardOwner inside a static
                                                            //function
         public void lostOwnership(Clipboard clipboard, Transferable contents){}/*procedure*/Any help would be appreciated, even if you can possibly point me in the right direction.
    Edited by: Bherms on Dec 13, 2009 10:41 PM

    It works just fine for me (no syntax errors):
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import javax.swing.*;
    public class ClipBoardTest implements ClipboardOwner
         private static JFrame frame  = new JFrame("HTS Programming 12");
         private static JTextArea ta;
         private static JButton start = new JButton("START");
         private ClipboardOwner co = this;//must do this because need to use "this" as the ClipboardOwner inside a static
                                                            //function
         public void lostOwnership(Clipboard clipboard, Transferable contents){}/*procedure*/
    }

  • Java system copy problems with the Java Migration Toolkit

    During the JAVA system copy, we have have got the error in second last
    step i.e;Java Migration Toolkit. We tried to do the system copy twice
    but every time we have got the below error.
    Is this a know bug? I have got the OSS note 966752 but the value
    of 'src.ci.host' is already correct. has anybody come across the similar issue. please help.
    " CJSlibModule::writeInfo_impl()
    Output of /usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties is written to the
    logfile /home/cmtadm/CI_Import_08312009/runJmt.log.
    WARNING 2009-09-01 20:49:43.473
    CJSlibModule::writeWarning_impl()
    Execution of the command "/usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties" finished with return code 27. Output:
    ERROR 2009-09-01 20:49:43.477
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.479
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.480 [iaxxgenimp.cpp:731]
    showDialog()
    FCO-00011 The step RunMigrationController with step key
    |NW_Doublestack_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CI_Instance|ind|ind|ind|ind|11|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|NW_RUN_MIGRATION_CONTROLLER|ind|ind|ind|ind|2|0|RunMigrationController was executed with status ERROR ."
    There is no log file by the name runJmt.log.
    Regards,
    Sagar

    This issue was resolved by OSS note 966752 itself. Below is the important line in the OSS note.
    Note: The default value is crucial! If a custom value other than the default value was applied, we highly recommend that you restore the default value.
    Thanks,
    Sagar

  • Problem of authorization in java system

    Hi all
    I have a problem of authorization.
    I have two sap system: SAP ERP, SAP Netweaver 2004s (only java).
    In my sap ERP I have configured some web services.
    Now I would use those web services from my Netweaver , so I execute those step:
    From sap erp:
    Transaction soamanagerlogon on sap erp  u201CBusiness Administrationu201D  Tab Page  u201Cweb Service Administrationu201D link choose my WS  link u201COpen Web Service navigator for selected bindingu201D now appear a login screen.
    I have created a user u201Cprovau201D with role and group everyone in the java system.
    When I try to login with user u201Cprovau201D the error message u201CYou donu2019t have authorization u2026u201D appear
    I Would know if exist something to Know the authorization to use that service to add at the user u201Cpippou201D.
    Thank you for collaboration     
    Best regards
    giovanni

    HI Thulasi
    thank you for your response.
    I opened  my browser on http://<my ip>:50000/index.html of the java system, I have choose "User Management" and
    selected my user but I didn't find the role "WSnavigator" . The roles that I have in the java system are:
    Administrator     
    CAFAdmin          
    CAFDeveloper     
    CAFUIAdmin
    Everyone
    SAP_ARCH_SUPERADMIN
    SAP_ARCH_XMLDAS_VIEW     
    SAP_JAVA_NWADMIN_CENTRAL                    
    SAP_JAVA_NWADMIN_CENTRAL_READONLY
    SAP_JAVA_NWADMIN_LOCAL
    SAP_JAVA_NWADMIN_LOCAL_READONLY     
    SAP_JAVA_SUPPORT
    Must I choose this role from visual administrator?
    Thank you for collaboration.
    Best regards
    giovanni

  • Problem while installing java system application server 8.2

    Hi
    i am trying to install Java System Access Manager 8.2 on LINUX and during this process i am getting the below error.
    Valid DNS Domain Name is required.
    The DNS Domain name provided could not be validated.
    The server being installed require a valid internet name.
    Installation cannot proceed until a valid DNS Domain Name is provided.
    The above arror is at COMMON SERVER SETTINGS window.
    help me out.
    varun

    Hi,
    This is a problem with your DNS settings (or lack of), not with Sun Java System Application Server/Access Manager.
    You will need to setup DNS before installing.
    One of these articles may help you:
    http://www.aboutdebian.com/dns.htm
    http://www.troubleshooters.com/linux/dns.htm
    http://www.linux.org/docs/ldp/howto/DNS-HOWTO.html
    Hope this helps....

  • Problems copying from PJC to system clipboard

    I am working on a PJC to allow for editing of large text fields (> 64K). I have most of the functionality working fine. However, I am having a problem using cut, copy, and paste.
    Some details, the PJC extends VBean and includes as JTextArea. Our users want a right click menu to provide functionality for cutting, copying, pasting, and spell checking. I was able to get the spell check working using JSpell. I am not able to get the menu entries for cut, copy, and paste to work. I construct a JPopMenu with the appropriate items. When the menu is activated, if the user selects cut, the actionPerformed method executed the cut method of the JTextArea. This does cut the text from the item, however it is not added to the clipboard for use in other items, except those that have the same implementation class of the original item. If the user uses the keyboard (CTRL-X, CTRL-C, or CTRL-V) the selected data is copied to the system clipboard
    Here is the method I used to create the menu items:
      private JMenuItem makeMenuItem(String label, char acceleratorKey)
        JMenuItem item = new JMenuItem(label);
        item.addActionListener(this);
        item.setMnemonic(acceleratorKey);
        item.addKeyListener(this);
        printDebugMessage("Horizontal text alignment = " + item.getHorizontalAlignment());
        item.setHorizontalAlignment(SwingConstants.LEFT);
        printDebugMessage("Horizontal text alignment = " + item.getHorizontalAlignment());
        return item;
      }Here is the actionPerformed method:
      public void actionPerformed(ActionEvent ae)
        String selection = ae.getActionCommand();
        if (selection.equals("Cut"))
          printDebugMessage("Cut selected");
          text.cut();
        else if (selection.equals("Copy"))
          printDebugMessage("Copy selected");
          text.copy();
        else if (selection.equals("Paste"))
          printDebugMessage("Paste selected");
          text.paste();
        else if (selection.equals("Spell Check"))
          printDebugMessage("Spell Check selected");
          doSpellCheck();
      }I read that jar files needed to be signed to interact with the desktop, but when I signed the jar file the results were the same.
    Platform
    10g AS on Solaris 10.1.2.2
    Windows XP (SP2)
    IE7
    Sun plugin 1.5.0_11 (problem also occurs with 1.4.2_06)
    Any insights would be helpful.
    Thanks

    will that create a problem?Try it and see.

  • Problem removing SAP java system

    Hi everyone,
    I've been trying to remove a SAP java system using the uninstall program and have been encountering a problem with the following log:
    WARNING 2006-05-09 17:26:24
    Error 1053 (The service did not respond to the start or control request in a timely fashion.
    ) in execution of a 'StartService' function, line (273), with parameter (XServer).
    WARNING 2006-05-09 17:26:56
    Error 1057 (The account name is invalid or does not exist, or the password is invalid for the account name specified.
    ) in execution of a 'StartService' function, line (1310), with parameter (XServer).
    ERROR 2006-05-09 17:26:56
    MOS-01199  Could not start the 'XServer' service on host 'Local'.
    What could be the possible cause of this error?
    In addition to that, I've also been trying to create a new instance but encountered these two error messages in the sdbinst.log
    cannot do update check - test file "d:/sapdb/adm/db/pgm/kernel.exe" not found
    installation exited abnormally  at Tu, May 09, 2006 at 17:34:37
    Thanks,
    Michael

    Hi Michael,
    this usually appears in case you stop deinstallation somewhere in the middle. XServer is a service of MaxDB, the DB delivered from SAP.
    You could try the program sapstartsrv, which gives you the option to deinstall some services. For this you have to know the SID you gave to the system (also a directory name in the usr/sap/ path with three letters). For XServer please refer to the databases manual.
    Regards,
    Benny

  • Java System Communications Express attachment problem

    Hello everyone, please excuse my ignorance on this query as I have very little to do with the Java language and I've really approached this forum as I've run out of ideas for the problem my customer has.
    The customer is connecting to a 'Sun Java System Communications Express' server, from approximately 20 PC's. 2 of the PC's have a problem that is not user based because if they sign in elsewhere their problem disappears and likewise if someone signs into their PC, they experience the same problem.
    If the user receives an email with an attachment and forwards it to a recipient, no problem.
    If the user recieves an emal with an attachment and forwards it to themselves, no problem.
    If however, the user tries to send an email with an attachment (which for all intents and purposes seems to take the correct amount of time to upload, and when you click save appears in the message attached) the attachment disappears, including if you simply save the message in drafts and do not actually send it.
    I have tried uninstalling and reinstalling versions 5 and 6 of Java, resetting the web settings using both IE6 and IE7 (unfortunately the initial secure server refuses any other connections from Firefox / Netscape / Opera / Safari therefore I can only test with IE)
    I have disabled all additional addons, disabled all non-microsoft startup services, disabled all startup programs.
    As you will appreciate, I've done a fair and reasonable amount of testing and simply cannot work out why the attachment fails to stay with the email on these two machines. Help on this problem would be very much greatly appreciated.
    Many Thanks
    Tony

    Unfortunately I do not have access to version information of the server as I am only have access to the client end. All that I can provide you with is the fact that it works on 18 identical systems. The missing attachment(s) occur regardless of whether you save the message to draft or send the message. It should be noted however that if you receive an attachment with a message and save that to drafts, the message retains the attachment so it only seems as though it is affected during the phase of attaching the file to the message from the local PC. The environment that the client is working in uses a verified certificate and is connected through https.

  • Deployment problems on Sun Java System AS

    When I read the toplink deployment XML file, during the deployment of my application on the Sun Java System AS,
    I get many toplink errors. Does someone know for what reason it happened?
    I get the following errors:
    Error code: 82
    SECURITY_ON_FIND_METHOD
    Error code: 86
    SECURITY_WHILE_INITIALIZING_ATTRIBUTES_IN_ INSTANCE_VARIABLE_ACCESSOR
    Error code: 87
    SECURITY_WHILE_INITIALIZING_ATTRIBUTES_IN_ METHOD_ACCESSOR
    Note: the application deploys whitout any problem on tomcat.

    TopLink requires reflective access to run. It is possible you need to configure your java policy file with the following permission for TopLink and the applications that use it.
    //grant permission for OracleAS TopLink to use reflection
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";

  • Sun Java System Portal Server 7 Problems with IE7

    Hello,
    I have just finished deploying Sun Java System Portal Server 7 on a Sparc box when I try to log in on IE6 or IE7 nothing happens.
    What could be the problem and how do I get the logs of what could be going wrong
    Thanks

    is the problem only w/ IE6 and 7? or is that just all that you've tried? :) on a *nix platform, you can find the portal logs at:
    /var/opt/SUNWportal/logs/...and
    /var/opt/SUNWportal/portals/<portal-id>/logs/<instance-id>/...there is also the web container log, the location of which varies depending on the vendor. for example, for SJS app server 8.2, the logs are at:
    /var/opt/SUNWappserver/domains/domain1/logs/hope this helps.

  • Using system clipboard w/ java

    Does anyone know how java can input a string into the system clipboard that can be accessed later?

    public void Copyit() {
          try{
          getit = area.getSelectedText();
          c = Toolkit.getDefaultToolkit().getSystemClipboard();
           Transferable contents = clipboard.getContents( im );
               c.setContents( contents, null );
              if(getit.equalsIgnoreCase("null")){ throw null; }
           }catch(NullPointerException nul){ System.out.print("Clipboard is emty");} 
      public void Pasteit() {
              c = Toolkit.getDefaultToolkit().getSystemClipboard();
              Transferable contents = c.getContents(this);
              String getit1 = "";
              try {
                getit1 = ( String ) contents.getTransferData( DataFlavor.stringFlavor );
            if(getit.equalsIgnoreCase("null")) { getit = null;
               throw null; }
               else
                field.setText(getit1);
             }catch(NullPointerException e ) {
               System.out.println( "Unable to read system clipboard" ); }    catch(Exception ee ) {
               System.out.println( "Unable to read system clipboard" ); }
    }here is two function that will work on a textfild/textarea you just have to piece the rest together which is not much or hard

  • Problem with GlassFish and Sun Java System Message Queue

    Hi,
    I used application server PE.8 and I upgraded to Sun Java System Application Server Platform Edition 9.0 Update 1 Patch 1, and I changed all my CLASSPATH and everything. My system is working fine, but the Sun Java System Message Queue that I used before is still showing the queues and physical queues of the previous application server, not the new one. Do you know if there is way to change that and link it to the new version?
    thanks

    Use an ESB like ServiceMix to bridge JMS providers
    http://servicemix.org/
    Or write your own MessageListener to consume from one JMS and publish on another one. Be careful with queues to avoid loosing the ordering - so you probably want to use a single MessageListener per subscription/queue - or to take advantage of Tibco's exclusive queues to ensure ordering is preserved. If ordering doesn't matter then don't worry too much about it and maybe have a pool of consumers to improve throughput
    James
    http://logicblaze.com/

  • Problem in starting Sun Java System Application Server

    Hi,
    Recently I installed SJSAS 8.1 on my machine (Windoes 2000), before that I was working on SJSAS8.0 and it was working file. But with 8.1 when I try to "Start Default Server". I get the following error on the console:
    Starting Domain domain1, please wait.
    Log redirected to D:\netbeans-4.1beta\SunAppServer8.1\domains\domain1\logs\server.log.
    Timeout waiting for domain domain1 to go to starting state.
    CLI156 Could not start the domain domain1.
    Press any key to continue . . .
    The contents of server.log are:
    [#|2005-03-29T15:07:14.242+0530|INFO|sun-appserver-pe8.1|javax.enterprise.tools.launcher|_ThreadID=10;|
    D:/Java/jdk1.5\bin\java
    -client
    -Xmx512m
    -XX:NewRatio=2
    -Dcom.sun.aas.defaultLogFile=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/logs/server.log
    -Djava.endorsed.dirs=D:/netbeans-4.1beta/SunAppServer8.1/lib/endorsed
    -Djava.security.policy=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/config/server.policy
    -Djava.security.auth.login.config=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/config/login.conf
    -Dsun.rmi.dgc.server.gcInterval=3600000
    -Dsun.rmi.dgc.client.gcInterval=3600000
    -Djavax.net.ssl.keyStore=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/config/keystore.jks
    -Djavax.net.ssl.trustStore=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/config/cacerts.jks
    -Djava.ext.dirs=D:/Java/jdk1.5/jre/lib/ext;D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1/lib/ext
    -Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver
    -Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
    -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
    -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
    -Dcom.sun.enterprise.taglisteners=jsf-impl.jar
    -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
    -Dcom.sun.aas.configName=server-config
    -Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter
    -Ddomain.name=domain1
    -Djmx.invoke.getters=true
    -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
    -Dcom.sun.aas.promptForIdentity=true
    -Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser
    -Dcom.sun.aas.instanceRoot=D:/netbeans-4.1beta/SunAppServer8.1/domains/domain1
    -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
    -Dcom.sun.aas.domainName=domain1
    -Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
    -Dproduct.name=Sun-Java-System/Application-Server
    -Dcom.sun.enterprise.overrideablejavaxpackages=javax.faces,javax.servlet.jsp.jstl,javax.xml.bind,javax.help
    -Dcom.sun.aas.configRoot=D:/netbeans-4.1beta/SunAppServer8.1/config
    -Djava.library.path=D:\Java\jdk1.5\jre\bin\client;D:\netbeans-4.1beta\SunAppServer8.1\lib;D:\netbeans-4.1beta\SunAppServer8.1\lib;D:\Java\jdk1.5\bin;.;D:\WINNT\system32;D:\WINNT;D:\netbeans-4.1beta\SunAppServer8.1\lib;D:\netbeans-4.1beta\SunAppServer8.1\bin;D:\netbeans-4.1beta\SunAppServer8.1\lib;D:\netbeans-4.1beta\SunAppServer8.1\bin;D:\netbeans-4.1beta\SunAppServer8.1\bin;D:\netbeans-4.1beta\SunAppServer8.1\bin;D:\WINNT\system32;D:\WINNT;D:\WINNT\System32\Wbem;D:\Java\jdk1.5\bin;D:\netbeans-4.1beta\SunAppServer8.1\bin;
    -Dcom.sun.aas.instanceName=server
    -Dcom.sun.aas.processLauncher=SE
    -cp
    D:/Java/jdk1.5/lib/tools.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib/appserv-rt.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\activation.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\admin-cli.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-admin.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-cmp.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-ext.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-jstl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-rt1.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\appserv-upgrade.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\commons-launcher.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\commons-logging.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\dom.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\j2ee-svc.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\j2ee.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jax-qname.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jaxr-api.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jaxr-impl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jaxrpc-api.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jaxrpc-impl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jmxremote.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jmxremote_optional.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jsf-api.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\jsf-impl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\mail.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\relaxngDatatype.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\rmissl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\saaj-api.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\saaj-impl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\xalan.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\xercesImpl.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib\xsdlib.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib/install/applications/jmsra/imqjmsra.jar;D:/netbeans-4.1beta/SunAppServer8.1/imq/lib/jaxm-api.jar;D:/netbeans-4.1beta/SunAppServer8.1/imq/lib/fscontext.jar;D:/netbeans-4.1beta/SunAppServer8.1/lib/ant/lib/ant.jar;D:/netbeans-4.1beta/SunAppServer8.1/pointbase/lib/pbclient.jar;D:/netbeans-4.1beta/SunAppServer8.1/pointbase/lib/pbembedded.jar
    com.sun.enterprise.server.PEMain
    start
    display
    native|#]
    *** EXITING ERROR:
    Can't create Java VM
    I guess I have searched every possible discussion/bug database/forums on this topic but unable to find a solution, please help.
    Regards
    Nitin

    Reply please.
    Thanks in advance.
    amyt

  • Applet access to system Clipboard

    Hi all:
    I am creating a customized version of the mud telnet application for a customer. They have requested cut/paste functionality and I have been able to provide this capability. The problem is the applet cannot get access to the system clipboard so all cut/paste functions can only occur within the applet. I am able to access the system clipboard by creating a java.policy file and setting a permission. The problem is that most of the workstations, and a good number that will be using home computers running Win 98. They don't want the users to have to download the new JRE from Sun (although I know this works). I am looking for a way to creat a JAR file using the old JDK 1.1 (or the current toolkit if it is possible) that will allow access from the Applet to the System Clipboard. I have search the web for an answer, with no success. Can anyone give me any suggestions?
    Anybody had to do the same thing before?
    Thanks.
    John Kreiner

    I know this is an old thread, but I thought I would answer it.
    To access the clipboard via an applet, you need to use JavaScript.
    The first thing to do is to create a class that uses reflection to use the JSObject. The reason why reflection is used is because it is a pain (ITA) to specify a compatible binary for eacy java version (e.g. java40.jar, plugin.jar, jaws.jar, etc). Here is the class:
    import java.lang.reflect.*;
    import java.applet.Applet;
    public class JavaScript {
         public static void call(Applet applet, String methodName, Object[] param) {
              try {
                   Class js = Class.forName("netscape.javascript.JSObject");
                   Method callMethod = js.getMethod("call", new Class[] { String.class, Object[].class });
                   callMethod.invoke(getWindow(applet), new Object[] { methodName, param});
              } catch (Throwable t) {}
         public static Object getWindow(Applet applet) {
              Object o = null;
              try {
                   Class js = Class.forName("netscape.javascript.JSObject");
                   Method getWindowMethod = js.getMethod("getWindow", new Class[] { Applet.class });
                   o = getWindowMethod.invoke(null, new Object[] { applet });
              } catch (Throwable t) {}
              return o;
    }Now, when you want to copy something to the clipboard, you will do:
    JavaScript.call(someApplet, "copyToClipboard", text);
    BUT the "copyToClipboard" function has not been defined yet. This will be a JavaScript function in the html:
    <script language="JavaScript1.1">
    function copyToClipboard(text) {
         document.myForm.myInput.value = text;
         var rng = document.myForm.myInput.createTextRange();
         rng.execCommand("RemoveFormat");
         rng.execCommand("Copy");
    </script>And one last thing is that a JavaScript text component is required in order to create the "rng" variable. To do this, use a hidden field in the html:
    <form name="myForm">
         <input name="myInput" type="hidden">
         </input>
    </form>

  • Paste from System Clipboard

    Hi,
    I've been looking all over on how to copy and paste to/from the system clipboard. I've used the tutorial classes at http://java.sun.com/developer/technicalArticles/releases/data/ explaining new data transfer capabilities in java, and it seems that I can copy and paste to/from a java application but I can't seem to paste images from the system clipboard in applications such as Thunderbird and OpenOffice.
    I'm not sure what the problem or solution is, but if anyone has any ideas that would be great. I was thinking it may be that in the tutorial it is copying the content of a JComponent to the system clipboard but I'm pretty sure that is not it.
    Any help is appreciated.
    thanks

    import java.awt.*;
    import java.awt.datatransfer.*;
    public class ClipboardImage
          *  Retrieve an image from the system clipboard.
          *  @return     the image from the clipboard or null if no image is found
         public static Image read()
              Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents( null );
            try
                if (t != null && t.isDataFlavorSupported(DataFlavor.imageFlavor))
                    Image image = (Image)t.getTransferData(DataFlavor.imageFlavor);
                    return image;
            catch (Exception e) {}
            return null;
          *  Place an image on the system clipboard.
          *  @param  image - the image to be added to the system clipboard
         public static void write(Image image)
            if (image == null)
                throw new IllegalArgumentException ("Image can't be null");
              ImageTransferable transferable = new ImageTransferable( image );
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(transferable, null);
        static class ImageTransferable implements Transferable
            private Image image;
            public ImageTransferable (Image image)
                this.image = image;
            public Object getTransferData(DataFlavor flavor)
                 throws UnsupportedFlavorException
                if (isDataFlavorSupported(flavor))
                     return image;
                else
                    throw new UnsupportedFlavorException(flavor);
            public boolean isDataFlavorSupported (DataFlavor flavor)
                  return flavor == DataFlavor.imageFlavor;
            public DataFlavor[] getTransferDataFlavors ()
                return new DataFlavor[] { DataFlavor.imageFlavor };
         public static void main(String[] args)
              Image image = Toolkit.getDefaultToolkit ().createImage("???.jpg");
              ClipboardImage.write( image );
              javax.swing.ImageIcon icon = new javax.swing.ImageIcon( ClipboardImage.read() );
              javax.swing.JLabel label = new javax.swing.JLabel( icon );
              javax.swing.JFrame frame = new javax.swing.JFrame();
              frame.setDefaultCloseOperation( javax.swing.JFrame.EXIT_ON_CLOSE );
              frame.getContentPane().add( label );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

Maybe you are looking for

  • Unable to create a report based on a text field which returns , separat val

    hi, i have created a sql report which fetches the values depending on values in text field, select * from emp where empno in :P2_xwhere P2_x is a text field, if i enter only one value then report is generated and if i enter two values separated by ",

  • How to enable a disabled radio button????

    Hi here is the problem i have, i have a number of radio buttons contained in a buton group, all the buttons bar the first one are disabled. The buttons are all drawn on a JPanel. What i want to be able to do is once the enabled button has been select

  • How to find cause of "File cannot be found" in sync iphoto to iphone in itunes?

    Hi can anyone help with syncing iPhoto to iPhone ?     I know similar posts exist on this subject but I have spent 4 days reading them and every support article even vaguely related to it but have not found a solution that works for me.   I have down

  • Can't Install Proper Version

    I downloaded the correct version for my OSX processor.  When I tried to install it, a dialogue box came up saying I couldn't because "devices with PowerPC are no longer supported."  It instructed me to download a version for PowerPC, but that's not w

  • ME23N - Approver display incorrect

    In ME23N under Release strategy tab there is an PO Approver. In our system, it displays X on one server and Y on other server application server on the same SAP instance. However this rectifies itself to X which is correct after 15 - 20 mins. I am as