Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » StackOverflow in setText
StackOverflow in setText [message #450169] Wed, 09 February 2005 08:26 Go to next message
Luis Verge González is currently offline Luis Verge GonzálezFriend
Messages: 2
Registered: July 2009
Junior Member
Hi all,

I have a problem when I use the setText() method of the Text.class.
(org.eclipse.swt.widget) When I set a text very large this method send a
StackOverflow error, the text length is 5504 and the length-limit of the
OS is greater than it. I have found the problem in the line of this method
that calls the OS. I'm working under Windows Xp and the RAM memory of my
computer is 512MB.

Questions
1. Is a bug in Text?
2. Can I solve the problem?

Thanks and sorry for my English
Re: StackOverflow in setText [message #450286 is a reply to message #450169] Wed, 09 February 2005 15:38 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
I am running Windows XP with a manifest against SWT from HEAD.
I ran the following example and did not get an error. Can you modify this
example to demonstrate the problem you are having?

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
Text t = new Text(shell, SWT.MULTI | SWT.WRAP);
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < 10000; i++) {
buffer.append('a');
}
buffer.append('z');
t.setText(buffer.toString());
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}


"Luis" <lvergegon@hotmail.com> wrote in message
news:cuchge$koc$1@www.eclipse.org...
>
> Hi all,
>
> I have a problem when I use the setText() method of the Text.class.
> (org.eclipse.swt.widget) When I set a text very large this method send a
> StackOverflow error, the text length is 5504 and the length-limit of the
> OS is greater than it. I have found the problem in the line of this method
> that calls the OS. I'm working under Windows Xp and the RAM memory of my
> computer is 512MB.
> Questions
> 1. Is a bug in Text?
> 2. Can I solve the problem?
>
> Thanks and sorry for my English
>
Re: StackOverflow in setText [message #450296 is a reply to message #450286] Wed, 09 February 2005 18:01 Go to previous messageGo to next message
Luis is currently offline LuisFriend
Messages: 20
Registered: July 2009
Junior Member
First of all thank you.
I can't show the code because is a private application.
On the other hand, when I ran a similar sample I did not get this error,
but when I extend eclipse platform, creating a plugin-view with a
multiline Text in this view, if I copy a large text to this multiline I
get the error. If you want to obtain a similar error, you can write a
large text in a text field of the plug-in manifest view. I must say that
my application is very large and in order to register text-changes in the
view I use a selectionChangedListener.

Thanks again.



Veronika Irvine wrote:

> I am running Windows XP with a manifest against SWT from HEAD.
> I ran the following example and did not get an error. Can you modify this
> example to demonstrate the problem you are having?

> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setLayout(new FillLayout());
> Text t = new Text(shell, SWT.MULTI | SWT.WRAP);
> StringBuffer buffer = new StringBuffer();
> for (int i = 0; i < 10000; i++) {
> buffer.append('a');
> }
> buffer.append('z');
> t.setText(buffer.toString());
> shell.open ();
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }


> "Luis" <lvergegon@hotmail.com> wrote in message
> news:cuchge$koc$1@www.eclipse.org...
>>
>> Hi all,
>>
>> I have a problem when I use the setText() method of the Text.class.
>> (org.eclipse.swt.widget) When I set a text very large this method send a
>> StackOverflow error, the text length is 5504 and the length-limit of the
>> OS is greater than it. I have found the problem in the line of this method
>> that calls the OS. I'm working under Windows Xp and the RAM memory of my
>> computer is 512MB.
>> Questions
>> 1. Is a bug in Text?
>> 2. Can I solve the problem?
>>
>> Thanks and sorry for my English
>>
Re: StackOverflow in setText [message #450298 is a reply to message #450296] Wed, 09 February 2005 21:15 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Try using as StyledText instead of a Text control. Does it fail?

"Luis" <lvergegon@htomail.com> wrote in message
news:cudj6k$hkk$1@www.eclipse.org...
> First of all thank you.
> I can't show the code because is a private application.
> On the other hand, when I ran a similar sample I did not get this error,
> but when I extend eclipse platform, creating a plugin-view with a
> multiline Text in this view, if I copy a large text to this multiline I
> get the error. If you want to obtain a similar error, you can write a
> large text in a text field of the plug-in manifest view. I must say that
> my application is very large and in order to register text-changes in the
> view I use a selectionChangedListener.
>
> Thanks again.
>
>
>
> Veronika Irvine wrote:
>
> > I am running Windows XP with a manifest against SWT from HEAD.
> > I ran the following example and did not get an error. Can you modify
this
> > example to demonstrate the problem you are having?
>
> > public static void main (String [] args) {
> > Display display = new Display ();
> > Shell shell = new Shell (display);
> > shell.setLayout(new FillLayout());
> > Text t = new Text(shell, SWT.MULTI | SWT.WRAP);
> > StringBuffer buffer = new StringBuffer();
> > for (int i = 0; i < 10000; i++) {
> > buffer.append('a');
> > }
> > buffer.append('z');
> > t.setText(buffer.toString());
> > shell.open ();
> > while (!shell.isDisposed ()) {
> > if (!display.readAndDispatch ()) display.sleep ();
> > }
> > display.dispose ();
> > }
>
>
> > "Luis" <lvergegon@hotmail.com> wrote in message
> > news:cuchge$koc$1@www.eclipse.org...
> >>
> >> Hi all,
> >>
> >> I have a problem when I use the setText() method of the Text.class.
> >> (org.eclipse.swt.widget) When I set a text very large this method send
a
> >> StackOverflow error, the text length is 5504 and the length-limit of
the
> >> OS is greater than it. I have found the problem in the line of this
method
> >> that calls the OS. I'm working under Windows Xp and the RAM memory of
my
> >> computer is 512MB.
> >> Questions
> >> 1. Is a bug in Text?
> >> 2. Can I solve the problem?
> >>
> >> Thanks and sorry for my English
> >>
>
>
Re: StackOverflow in setText [message #450311 is a reply to message #450298] Thu, 10 February 2005 10:58 Go to previous message
Luis Verge González is currently offline Luis Verge GonzálezFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks, I solved the problem It was a java.string.matches problem, not swt
problem. It's a java bug.

Thanks everybody.


Steve Northover wrote:

> Try using as StyledText instead of a Text control. Does it fail?

> "Luis" <lvergegon@htomail.com> wrote in message
> news:cudj6k$hkk$1@www.eclipse.org...
>> First of all thank you.
>> I can't show the code because is a private application.
>> On the other hand, when I ran a similar sample I did not get this error,
>> but when I extend eclipse platform, creating a plugin-view with a
>> multiline Text in this view, if I copy a large text to this multiline I
>> get the error. If you want to obtain a similar error, you can write a
>> large text in a text field of the plug-in manifest view. I must say that
>> my application is very large and in order to register text-changes in the
>> view I use a selectionChangedListener.
>>
>> Thanks again.
>>
>>
>>
>> Veronika Irvine wrote:
>>
>> > I am running Windows XP with a manifest against SWT from HEAD.
>> > I ran the following example and did not get an error. Can you modify
> this
>> > example to demonstrate the problem you are having?
>>
>> > public static void main (String [] args) {
>> > Display display = new Display ();
>> > Shell shell = new Shell (display);
>> > shell.setLayout(new FillLayout());
>> > Text t = new Text(shell, SWT.MULTI | SWT.WRAP);
>> > StringBuffer buffer = new StringBuffer();
>> > for (int i = 0; i < 10000; i++) {
>> > buffer.append('a');
>> > }
>> > buffer.append('z');
>> > t.setText(buffer.toString());
>> > shell.open ();
>> > while (!shell.isDisposed ()) {
>> > if (!display.readAndDispatch ()) display.sleep ();
>> > }
>> > display.dispose ();
>> > }
>>
>>
>> > "Luis" <lvergegon@hotmail.com> wrote in message
>> > news:cuchge$koc$1@www.eclipse.org...
>> >>
>> >> Hi all,
>> >>
>> >> I have a problem when I use the setText() method of the Text.class.
>> >> (org.eclipse.swt.widget) When I set a text very large this method send
> a
>> >> StackOverflow error, the text length is 5504 and the length-limit of
> the
>> >> OS is greater than it. I have found the problem in the line of this
> method
>> >> that calls the OS. I'm working under Windows Xp and the RAM memory of
> my
>> >> computer is 512MB.
>> >> Questions
>> >> 1. Is a bug in Text?
>> >> 2. Can I solve the problem?
>> >>
>> >> Thanks and sorry for my English
>> >>
>>
>>
Previous Topic:Fullscreen Application
Next Topic:pocket pc, J9 - Tree
Goto Forum:
  


Current Time: Thu Apr 25 03:56:03 GMT 2024

Powered by FUDForum. Page generated in 0.04908 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top