harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chunrong Lai (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4656) [classlib][awt] System ClipBoard is not initialized well in Linux
Date Tue, 21 Aug 2007 10:13:30 GMT
[classlib][awt] System ClipBoard is not initialized well in Linux
-----------------------------------------------------------------

                 Key: HARMONY-4656
                 URL: https://issues.apache.org/jira/browse/HARMONY-4656
             Project: Harmony
          Issue Type: Bug
         Environment: Fedora(Linux32)
            Reporter: Chunrong Lai



 In Fedora NullException is observed in the simple example:

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;

public class Test {
  public static void main (String argv[]) {
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    Transferable tb = clipboard.getContents(null);
    try {
      String text = (String) tb.getTransferData(DataFlavor.stringFlavor);
      if (text != null && !text.equals(""))
      {
         System.out.println("The Clipboard is not null with String");
      } else {
         System.out.println("The Clipboard is null with String");
      }
    }
    catch (UnsupportedFlavorException e){
      e.printStackTrace();
    }
    catch (IOException e){
      e.printStackTrace();      
    }
    catch (Exception e){
      e.printStackTrace();      
    }
  }
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message