getSystemClipboard != system clipboard

2001-04-15 Thread Dick Repasky


Why doesn't a call to getSystemClipboard give me what's in the
system clipboard?  Briefly, I'm working under Linux using X
windows.  I load something into the system clipboard from an
xterm using the left mouse button.  Then, when I move into my
application and click on a home-grown paste button that
uses the getSystemClipboard call, I get nothing.  Ironically,
X11 copy and paste operations that rely solely on the left and
middle mouse buttons work fine.  I can also copy into the system
clipboard using the mouse in an xterm and then paste directly
into an editable TextArea just fine.

I'm coming to the conclusion that what java thinks is the system
clipboard isn't that at all.

What I'd like is a nice unified cut/copy/paste system.  That is,
I'd like to cut/copy/paste within an editable TextArea as
well as to cut/copy/paste between the text area and other
applications in Linux and Windows 98, using the mouse buttons
and/or cut/copy/paste buttons that are home-grown MenuItems,
complete with ctrl-x,c,v shortcuts.

So, if Java's system clipboard isn't really the system clip
board, what is it?

Thanks,

Dick


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: getSystemClipboard != system clipboard

2001-04-15 Thread Joi Ellis

On Sun, 15 Apr 2001, Dick Repasky wrote:

> 
> Why doesn't a call to getSystemClipboard give me what's in the
> system clipboard?  
[snip]

> So, if Java's system clipboard isn't really the system clip
> board, what is it?

I'm  not clear on the exact details since I'm not an X11 developer.
X11 supports both 'selection' and 'cut' concepts simultaneously.  Thus there
are several ways of accessing the system clipboard.  (Which, actually,
isn't a system clipboard, it's an X server clipboard.)

I'm guessing that since the Linux JVM is a port of the Windows JVM,
they picked the X11 method that most closely resembled Windows behavior,
probably to prevent the cacophony of whines that seem to arise whenver
something in Java isn't exactly like Windows. :p

Naturally, this is not the method acutally used by most native X11 
applications.

Xclipboard serves as a reasonable translation medium between X11 native apps
and whatever method the JVM is using.  Launch XClipboard, then
select your X11 text.  Paste it into an XClipboard view.  Now select
it again and you can now paste it into a Java app.  The reverse direction
also works.

Note, though, that 1.2.2 has a good chance of dumping core after doing
this more than once, and 1.3 has a smaller but still finite chance of
dumping core.  It's flakey enough that I avoid pasting between Java
and native X11 at all.

This is one of my pet peeves, too.
-- 
Joi EllisSoftware Engineer
Aravox Technologies  [EMAIL PROTECTED], [EMAIL PROTECTED]

No matter what we think of Linux versus FreeBSD, etc., the one thing I
really like about Linux is that it has Microsoft worried.  Anything
that kicks a monopoly in the pants has got to be good for something.
   - Chris Johnson


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: getSystemClipboard != system clipboard

2001-04-15 Thread Nathan Meyers

X has a mechanism called "selection" that supports cut and
paste. Selection associates data with a named buffer for transferring
between applications; you can name a buffer anything you want, but two
names have special meaning:

CLIPBOARD - this is the buffer used by applications that provide buttons
and/or keyboard shortcuts for copy, cut, and paste.

PRIMARY - this is the buffer used for data you drag/highlight with the
left mouse button.

The Java AWT only supports the first one - that's the one you're accessing
with getSystemClipboard(). If you want to get to the PRIMARY buffer,
you need to write some JNI code. Why doesn't AWT support the second one?
Because most other platforms don't have a comparable feature.

Nathan Meyers
[EMAIL PROTECTED]


On Sun, Apr 15, 2001 at 04:01:11PM -0500, Dick Repasky wrote:
> 
> Why doesn't a call to getSystemClipboard give me what's in the
> system clipboard?  Briefly, I'm working under Linux using X
> windows.  I load something into the system clipboard from an
> xterm using the left mouse button.  Then, when I move into my
> application and click on a home-grown paste button that
> uses the getSystemClipboard call, I get nothing.  Ironically,
> X11 copy and paste operations that rely solely on the left and
> middle mouse buttons work fine.  I can also copy into the system
> clipboard using the mouse in an xterm and then paste directly
> into an editable TextArea just fine.
> 
> I'm coming to the conclusion that what java thinks is the system
> clipboard isn't that at all.
> 
> What I'd like is a nice unified cut/copy/paste system.  That is,
> I'd like to cut/copy/paste within an editable TextArea as
> well as to cut/copy/paste between the text area and other
> applications in Linux and Windows 98, using the mouse buttons
> and/or cut/copy/paste buttons that are home-grown MenuItems,
> complete with ctrl-x,c,v shortcuts.
> 
> So, if Java's system clipboard isn't really the system clip
> board, what is it?
> 
> Thanks,
> 
> Dick
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> 


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




unexpected exception detected

2001-04-15 Thread Timothy Wojtaszek

Having a problem running anything with swing. 




tim@powerpuffer:~/Programming/java$ java start
Test
current locale is not supported in X11, locale is set to CX locale 
modifiers are not supported, using default# # An unexpected exception 
has been detected in native code outside the VM.# Program counter=0x4001f84c
#
# Problematic Thread: prio=5 tid=0x804e600 nid=0x3c3a runnable
#
Aborted

here's the code it fails on, but anything that seems to access  X dies.
if I remove the JOptionPane it works fine on the console.
(debian linux2.4.3, currently have j2sdk-1.3, but I have tried 1.1.8, 
1.2.2, ( both blackdown and ibm) )
so WHAT IS WRONG WITH MY SYSTEM.  this is driving me nuts.

import javax.swing.*;

public class start
{
   public static void main( String x[])
   {
   System.out.println("Test");
   JOptionPane.showMessageDialog(null,"tset");
   System.exit(0);
   }
}

thanks for any help, let me know if more information is needed.
tim




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]