Applet

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Applet

Postby bob » Mon Aug 17, 2009 11:30 pm

Hello Robert (another Robert...like me :D), hello all,

Sorry for my language but i don't speak well english...

I'm sorry but i don't know how to compile your java script into an applet. I never do that and i don't know where to start...

Is there a project for that, or a howto ?

The only thing i found it's this file :

Code: Select all
package org.fife.ui.rsyntaxtextarea.demo;

import javax.swing.*;

import org.fife.ui.rsyntaxtextarea.*;


/**
 * Demo application for {@link RSyntaxTextArea}.
 *
 * @author Robert Futrell
 * @version 1.0
 */
public class RSyntaxTextAreaDemoApplet extends JApplet {


   public RSyntaxTextAreaDemoApplet() {
      try {
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      } catch (Exception e) {
         e.printStackTrace(); // Never happens
      }
      setRootPane(new DemoRootPane());
   }


   public void start() {
      super.start();
      ((DemoRootPane)getRootPane()).focusTextArea();
   }


}


Itried to compile this class with that command :
java -classpath C:\Sun\AppServer\jdk\bin\rsyntaxtextarea.jar;. RSyntaxTextAreaDemoApplet

...but nothing append.

thanks
bob
 

Re: Applet

Postby bob » Mon Aug 17, 2009 11:41 pm

Edit : sorry, with that command :

javac -classpath C:\Sun\AppServer\jdk\bin\rsyntaxtextarea.jar RSyntaxTextAreaDemoApplet.java
bob
 

Re: Applet

Postby bob » Tue Aug 18, 2009 2:11 am

OK, i find the begening...
bob
 

Re: Applet

Postby robert » Tue Aug 18, 2009 3:31 am

Hi Bob,

Does your last reply mean you've figured it out?

If you want to build the RSTA demo, do the following:

  • Download the two projects RSyntaxTextArea and RSyntaxTextAreaDemo. Either get the latest of each from SourceForge, or from the Subversion repository if you like to stay on the bleeding edge (it usually stays pretty stable).

  • If you check them out using Eclipse, you can run either the standalone application or applet version of the RSTA demo by simply opening either RSyntaxTextAreaDemoApp.java or RSyntaxTextAreaDemoApplet.java (both in RSyntaxTextAreaDemo under src/org/fife/ui/rsyntaxtextarea/demo) and clicking "Run" in the toolbar. Or RMB -> Run As -> Java Application. Or however else you prefer to launch it. :) Although I don't use NetBeans, I'm sure it provides very similar functionality.

  • If you'd rather use just the command line, then assuming both projects share the same parent folder, build both projects with Apache Ant, then you can run the demo's executable jar:
    Code: Select all
         cd RSyntaxTextArea
         ant
         cd ../RSyntaxTextAreaDemo
         ant
         java -jar dist/rsyntaxtextarea_demo.jar

Let me know if you have any problems with this!
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm

Re: Applet

Postby bob » Wed Aug 19, 2009 3:09 am

Hi Robert,

Thanks for reply ! You are cool.

robert wrote:Does your last reply mean you've figured it out?

Let me know if you have any problems with this!


No problem with your explanations. I'm not using ANT for the moment, only the jdk and it seems that everything works.

For the moment, i just traduct your menu in french (the more easy :)) and now, i'm going to look for loading a file remotely (i don't know if it's easy to do that but i'm going to try...).

Have a good day.
bob
 

Re: Applet

Postby bob » Wed Aug 19, 2009 6:00 am

I've got another question if i can : is it possible to paste text from the clipboard ?
I can't do and i wonder wonder if this is normal ?
bob
 

Re: Applet

Postby robert » Wed Aug 19, 2009 4:41 pm

Yes, RSTA can access the clipboard. Are you running the applet demo in a browser? If so then it's likely because it's an unsigned applet, and unsigned applets can't access the clipboard. it should fall back to using a "local clipboard," however; that is, you can copy and paste within the applet's editor. Just access to/from the local system is forbidden.

If you wanted to use RSTA in an applet and have access to the system clipboard, you'd have to sign it first.
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm

Re: Applet

Postby bob » Thu Aug 20, 2009 1:23 am

robert wrote:Are you running the applet demo in a browser?


Yes. I'd like to use your applet to replace codepress which is no longer maintained... :o

robert wrote:If you wanted to use RSTA in an applet and have access to the system clipboard, you'd have to sign it first.


Ok. So let's go to sign it ;) Thanks.
bob
 


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron