[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Sharing a JTextField: what is the class for the shared model?  XML
Forum Index -> Terracotta DSO
Author Message
eluzcand

journeyman

Joined: 05/08/2008 06:28:25
Messages: 12
Offline

Similarly to post http://forums.terracotta.org/forums/posts/list/1045.page for a JCheckBox, I am now trying to share a JTextField across clustered Terracotta client GUIs. I tried to use javax.swing.text.PlainDocument as the shared model defined in ROOT similar to how the JCheckBox sample worked, but I am stuck with errors arond javax.swing.text.AbstractDocument not being non-portable. I tried the Ecilpse built-in "helper" features of the debugger to attempt to add locks and so on, but I cannot get it working.

Anyone has sample code for this? I am building a PoC and want to showcase this. I know that my issue is Swing lack of knowledge, but I cannot help that right now. :)

Thanks,
elf
jgalang

journeyman

Joined: 05/24/2006 15:08:59
Messages: 41
Offline

Instead of turning PlainDocument as root, which would drag an entire tree of classes with it (including classes that might not be TC portable at all/yet) it would be simpler in this case if create your own application's model that could be observed or that could send out notifications to update the model that your view uses.

I would suggest looking at the sample application generated by the pojo archetype http://forge.terracotta.org/releases/projects/pojo-archetype to accomplish this.

You will need to have Maven 2.0 installed - I've attached an archive of the sample app.



 Filename bazapp.tar.gz [Disk] Download
 Description
 Filesize 8 Kbytes
 Downloaded:  21 time(s)


Want to post to this forum? Please join the Terracotta community: >Sign up

gkeim

praetor

Joined: 12/05/2006 10:22:37
Messages: 247
Location: Terracotta, Inc.
Online

Find attached an update to the CheckBoxTest Eclipse project that adds a new TextField sample that adapts the TextField's document to a SharedString that is shared.
 Filename CheckBoxTest.jar [Disk] Download
 Description
 Filesize 4 Kbytes
 Downloaded:  23 time(s)


Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community
eluzcand

journeyman

Joined: 05/08/2008 06:28:25
Messages: 12
Offline

Thanks for the replies and examples. I understand some of my choices now!
 
Forum Index -> Terracotta DSO
Go to:   
Powered by JForum 2.1.7 © JForum Team