Mqtt and java to basics iot(s) projects

Hi,
I have a adapted  googlecreative Project running in my house. Is this use node.js, websocket, html5, but is don't have a public access (DDNS) and I'm not have a mobile app for it yet. I will  have a dyndns address..
Now, I'm wanting to use MQTT and solve this problem.
What do you thing about Eclipse Paho and MQTT (Java Messaging in the internet of the things) ??
e.g.: hardware : raspberry pi and arduino uno r3

Another possibility is NewJawin. You can also take a look at Jakarta POI,
but that's not really implemented. There's no good solution, but Jacob and
NewJawin are the two best I've found.

Similar Messages

  • AJAX producer/consumer and JAVA producer/consumer  in same project

    I've already successfully integrated and customized the code for both an AJAX and JAVA producer/consumer client in JMS (using ActiveMQ as the JMS broker and Tomcat as the webapp container). While both have been working well in separate projects, unfortunately, I'm having a bit of trouble trying to integrate them for the purpose of running an AJAX message listener and JAVA message listener in the same project.
    What I'm trying to do is have JAVA act as the failover for when the AJAX JMS consumer is not listening (i.e. when the browser is closed). When a browser client opens, the (constantly running) JAVA client can ignore the messages... but... when no browser client is initialized, the JAVA client should respond to the messages on behalf of the AJAX client.
    I've tried using a ServletContextListener pattern, which I was hoping would "automagically" launch the JAVA listener via its main method, whenever the Servlet gets initialized (i.e. it would auto-start when Tomcat gets restarted, or, anytime the Servlet gets redeployed) but it seems Tomcat is not thread-safe and this might be causing some problems.
    In any case, I can't seem to get the JAVA client to reliably start running and stay running for the lifetime of my AJAX client (webapp .war), and without including them in the same project and same J2EE container sharing the same ServletContext, I don't know how its possible to ensure they are running and starting and stopping at the same time.
    Is there perhaps a better way to accomplish this?
    Edited by: bcmoney on May 17, 2010 1:25 PM

    I've already successfully integrated and customized the code for both an AJAX and JAVA producer/consumer client in JMS (using ActiveMQ as the JMS broker and Tomcat as the webapp container). While both have been working well in separate projects, unfortunately, I'm having a bit of trouble trying to integrate them for the purpose of running an AJAX message listener and JAVA message listener in the same project.
    What I'm trying to do is have JAVA act as the failover for when the AJAX JMS consumer is not listening (i.e. when the browser is closed). When a browser client opens, the (constantly running) JAVA client can ignore the messages... but... when no browser client is initialized, the JAVA client should respond to the messages on behalf of the AJAX client.
    I've tried using a ServletContextListener pattern, which I was hoping would "automagically" launch the JAVA listener via its main method, whenever the Servlet gets initialized (i.e. it would auto-start when Tomcat gets restarted, or, anytime the Servlet gets redeployed) but it seems Tomcat is not thread-safe and this might be causing some problems.
    In any case, I can't seem to get the JAVA client to reliably start running and stay running for the lifetime of my AJAX client (webapp .war), and without including them in the same project and same J2EE container sharing the same ServletContext, I don't know how its possible to ensure they are running and starting and stopping at the same time.
    Is there perhaps a better way to accomplish this?
    Edited by: bcmoney on May 17, 2010 1:25 PM

  • I know c,c++ and java language ! and i want to contribute for development of mozilla products ! any idea where i can find beginner level projects ?

    I know c,c++ and java language ! and i want to contribute for development of mozilla products ! any idea where i can find beginner level projects ! so that i can hone some real development skills too :)

    You could also try jumping in on some of the Mozilla IRC chat channels as was suggested to someone else in another thread.
    Also you could also try the [/forums/buddies new contributors forum], it does now have an Admin monitoring and replying. (At the time of the quoted post Admins were almost impossible to get hold of for forum matters )
    ''Noah_SUMO [/forums/buddies/710569#post-61671 said]''
    <blockquote>
    Sorry I didn't see this earlier. :)
    I know just the places where I think you'd fit in best. To make sure, just join us in #sumodev and #mozwebqa and #communityit at irc://irc.mozilla.org
    I think your skills in php, javascript, python and server admin-y stuff will come in real handy at these places. :D
    For example, some help is needed here to fix these tests after a new theme was added to wiki.mozilla.org and they are in python. https://github.com/mozilla/wiki-tests - more info in #mozwebqa
    And maybe some help with perl might be needed with firebot, a irc bot written in perl. Channel #firebot for that.
    And #communityit (for server admin stuff) and #sumodev could use some help as well, just pop in and ask. :)
    </blockquote>
    Also see
    * [[Contributor News & Resources#w_communication-channels]]_communication-channels
    ** Mibbit link (this one for #sumo channel ) https://www.mibbit.com/?server=irc.mozilla.org&channel=%23sumo
    P.S. and see
    * https://wiki.mozilla.org/Good_first_bug

  • How can i merge javafx code and java fxml code in a single project

    how can i merge javafx code and java fxml code in a single project.
    Please let me Know as soon as possible.

    Everything that it is possible to retrieve from a class file can be deduced from the class file definition.
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
    Sylvia.

  • Basic (and I mean basic) java problem with a simple hello world script

    I have a simple cut-and-paste html page and java class in my /home/jc158027/java directory.
    jc158027> cat HelloWorld.java
    import java.applet.*;
    import java.awt.*;
    public class HelloWorld extends Applet{
    Label helloLabel = new Label ("Hello World");
    public void init () {
      setBackground (Color.yellow);
      add (helloLabel);
    }Ok, so I javac HelloWorld.java and get HelloWorld.class, so far so good.
    Next I create my html page:
    jc158027> cat hw.html
    <HTML>
    <HEAD>
    <TITLE>Jay's Java Test Page</TITLE>
    <BODY>
    <HR>
    This line of text comes before the applet.<P>
    <APPLET CODE = 'HelloWorld.class" WIDTH=500 Height=90>
    </APPLET>
    <P>
    This line of text comes after the applet.
    </BODY>
    </HTML>The result is that the text lines work, I get a nice grey box with no applet running. Looking at my console I get the following error:
    Caused by: java.io.FileNotFoundException: /home/jc158027/java/HelloWorld/class".class (No such file or directory)
    What I don't understand is the HelloWorld/class".class portion, shouldn't it be just either HelloWorld".class or HelloWorld/class, it is as though it is trying to look in a directory (class) that does not exist.
    What am I missing here?

    And if you put dots in where it expects a class name, it assumes those dots are to separate levels in a package name.
    So it was looking for a class named "class", which would be in a file called class.class, in a package named "HelloWorld". Packages correspond to directories relative to some classpath root, so it looked for the directory HelloWorld to be the parent of the classes in the HelloWorld package.

  • ESS and Java API documentation.

    Hi!We are just starting our first project with EES and java API.The documentation which comes with the package, does seems adequate.Does any other set exist? For example what is domain in EES interpretation?(domain essbase is used in all examples provided with in EES)?Vlad.

    Domain is the top level object within an "Essbase Deployment Services ("EDS") server object tree which is organized like this:Domain Accounts Users <user objects..> Servers Enterprise Servers 192.168.1.20 OLAP Servers 192.168.1.20 Sample Basic Exchrate etc.. Demo Basic 192.168.1.21 Appname DBname Take a look at the treeview in the EDS GUI console..Tim TowApplied OLAP, Inc

  • Java editor : NullPointerException : non-null project required

    hi
    While editing a Java source file, I get this exception on the "jdev.exe console" :
    Warning, runtime exception caught: java.lang.NullPointerException: non-null project required
    java.lang.NullPointerException: non-null project required
            at oracle.jdeveloper.java.JavaManager.getJavaManager(JavaManager.java:73)
            at oracle.jdevimpl.java.Context2ParserHelper.getJavaManager(Context2ParserHelper.java:113)
            at oracle.jdevimpl.java.Context2ParserHelper.getSourceFile(Context2ParserHelper.java:124)
            at oracle.jdevimpl.java.editing.JavaSmartClipboard.getSourceFile(JavaSmartClipboard.java:182)
            at oracle.jdevimpl.java.editing.JavaSmartClipboard.isInStringLiteral(JavaSmartClipboard.java:382)
            at oracle.jdevimpl.java.editing.JavaSmartClipboard.fillClipboard(JavaSmartClipboard.java:253)
            at oracle.jdevimpl.java.editing.JavaSmartClipboard.copy(JavaSmartClipboard.java:218)
            at oracle.jdevimpl.java.editing.JavaSmartClipboard.invokeAction(JavaSmartClipboard.java:100)
            at oracle.jdevimpl.java.editing.JavaEditingPlugin.invokeAction(JavaEditingPlugin.java:585)
            at oracle.javatools.editor.BasicEditorPane.invokeAction(BasicEditorPane.java:1949)
            at oracle.ide.ceditor.keymap.IdeKeymapHelper.invokeAction(IdeKeymapHelper.java:181)
            at oracle.javatools.editor.keys.MultiKeyHandler.keyPressed(MultiKeyHandler.java:334)
            at java.awt.Component.processKeyEvent(Component.java:5446)
            at javax.swing.JComponent.processKeyEvent(JComponent.java:2713)
            at java.awt.Component.processEvent(Component.java:5265)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
            at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
            at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
            at java.awt.Component.dispatchEventImpl(Component.java:3841)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Window.dispatchEventImpl(Window.java:1774)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)This happens with things like Ctrl+C (copy) or Ctrl+Space (code insight).
    Typing characters still works, but I would like some other basic features like "copy and paste" to work again.
    Any suggestions?
    (using JDeveloper 10.1.3.2.0.4066)
    many thanks
    Jan Vervecken

    Thanks for the update Brian.
    At first I had never heard of the name "PoemaFenix.jws" and because of that I thought it was JDeveloper that added the "Fenix" suffix because of some illegal state.
    But because of your update today, I looked into this and found some references to "PoemaFenix.jws" in the "dependencyList" of some of our .jpr files as "sourceOwnerURL". (These could have been introduced a while back when someone rearranged some of our project files, although I haven't been able to get this confirmed.)
    Anyway, I did not try the workaround you suggested, but I updated the .jpr files replacing "PoemaFenix.jws" with the correct name "Poema.jws" and I was not able to reproduce the issue using the scenario I used before. So, that looks like it solved the issue here (and the activeWorkspaceURL is <path>Poema.jws again).
    I also tried the following scenario to check how this could have been introduced:
    (1) create an application "MyFirstApp", resulting in "MyFirstApp.jws"
    (2) create two empty projects "Model" and "ViewController"
    (3) configure the ViewController project to be dependent on the Model project
    (4) Save All, and click the "Remove from Applications" icon while "MyFirstApp" is selected in the Applications Navigator
    (5) on the file system rename "MyFirstApp.jws" to "MySecondApp.jws"
    (6) open "MySecondApp.jws" in JDeveloper
    (7) on the ViewController project properties dependencies panel toggle the checkbox for the Model project off and on again, click OK
    This resulted in a "ViewController.jpr" file containing this:
       <hash n="oracle.ide.model.DependencyConfiguration">
          <list n="dependencyList">
             <hash>
                <value n="class" v="oracle.jdeveloper.library.ProjectLibrary"/>
                <url n="sourceOwnerURL" path="../MyFirstApp.jws"/>
                <url n="sourceURL" path="../Model/Model.jpr"/>
             </hash>
             <hash>
                <value n="class" v="oracle.jdeveloper.library.ProjectLibrary"/>
                <url n="sourceOwnerURL" path="../MySecondApp.jws"/>
                <url n="sourceURL" path="../Model/Model.jpr"/>
             </hash>
          </list>
       </hash>I would think the reference to MyFirstApp.jws should no longer be there.
    (Maybe the sourceOwnerURL values should be updated in step (6) of the above scenario, which is also not the case.)
    regards
    Jan Vervecken

  • Java Card Basics

    Hello People
    This is my first time working with Java Card and any other smart card related stuff.
    So I read the 3 parts of "An Introduction to Java Card Technology" and other two articles there.
    I have serveral inquires about the issue.
    Is the STK the same as sim.toolkit ? or is it a proprietry kit for each smart card manufacturer ?
    What is sim.toolkit ? is it different than what java card provides ?
    What I want to do is an applet on a SIM that sends encrypted SMSs.
    I read that java card applets are passive, does that mean when the applet is installed on the SIM,
    another app (probably J2ME) must activate and run it ?
    In my project, do I need to use sim.toolkit.* for SMS capabilities or java card got that?
    Exucse my ignorance in the matter, any help is appreciated,
    Regards

    So, no one is familiar with Java Card basics to clear some stuff for me ?

  • Java SE and Java EE

    I am a IT graduate and I still need some clarification on the relationship between Java SE and Java EE API. Does EE include SE?
    For application development, I know I can use only SE without the EE, but can I use EE alone without SE?
    Any good articles addressing my questions?
    Thank you very much
    R

    Java EE in fact extends java SE, its primarily aim is to simplify developing multitier enterprise applications (Java SE provides all the necessary basic libraries etc.)
    Because Java EE is an extension of Java SE, you cant use EE without SE - without SE there is no EE.

  • Sending email using SMTP and Java

    Hi guys
    I am using the following code to send an email:
    private void sendEmail(String mDate, String time) {       
            Date date = new Date();
            DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, Locale.ENGLISH);
            // Open port to server
            try {
              smtpSocket = new Socket(SMTP_SERVER, SMTP_PORT);
              os = new DataOutputStream(smtpSocket.getOutputStream());
              is = new DataInputStream(smtpSocket.getInputStream());
              // Connection was made.  Socket is ready for use.
              if(smtpSocket != null && os != null && is != null) {
                try {
                    // email header
                    os.writeBytes("HELO\r\n");
                    // set the reply email address
                    os.writeBytes("MAIL From: <[email protected]>\r\n");
                    // give the address of the people that we want the email sent to
                    for(int i=0; i<RECIPIENTS.length; i++) {
                        os.writeBytes("RCPT To: <" + RECIPIENTS[i] + ">\r\n");
                        System.out.println(RECIPIENTS);
    // data header
    os.writeBytes("DATA\r\n");
    os.writeBytes("X-Mailer: Via Java\r\n");
    os.writeBytes("DATE: " + dateFormat.format(date) + "\r\n");
    os.writeBytes("From: Characterisation System Update\r\n");
    os.writeBytes("Mime-Version: 1.0\r\n");
    os.writeBytes("Content-Type: text/html; charset=\"ISO-8859-1\"\r\n");
    //os.writeBytes("Content-Transfer-Encoding: 7bit;\r\n");
    for(int i=0; i<RECIPIENTS.length; i++) {
    os.writeBytes("To: <" + RECIPIENTS[i] + ">\r\n");
    // get the details of the test and enter them into the message body
    String message = "<HTML><BODY>" +
    "\r\nThe following System has not received a data packet for at leat 1 hour:" +
    "\r\n<BR/><BR/><B>System:</B> " + rackName +
    "\r\n<BR/><B>Time Last Pkt. Received:</B> " + time +
    "\r\n<BR/><B>Date Last Pkt. Received:</B> " + mDate +
    "\r\n<BR/><B>Job Number:</B> " + jobNoDispLabel.getText() +
    "\r\n<BR/><B>Device:</B> " + deviceDispLabel.getText() +
    "\r\n<BR/><B>Run Number:</B> " + runNoDispLabel.getText() +
    "\r\n<BR/><B>Current Temperature:</B> " + tempDispLabel.getText() +
    "\r\n<BR/><B>Current Module:</B> " + moduleDispLabel.getText() +
    "\r\n<BR/><B>Current Test:</B> " + testingDispLabel.getText() +
    "\r\n<BR/><BR/>This does not gurantee that the system has crashed!" +
    "\r\n</BODY></HTML>";
    os.writeBytes("Subject: " + rackName + " Packet Warning\r\n");
    os.writeBytes(message + "\r\n");
    os.writeBytes("\r\n.\r\n");
    os.writeBytes("QUIT\r\n");
    // Now send the email off and check the server reply.
    // Was an OK is reached you are complete.
    String responseline;
    //DataInputStream d = new DataInputStream(is);
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    while((responseline = reader.readLine())!= null) { 
    if(responseline.indexOf("Ok") != -1) {
    break;
    } catch(Exception e) {
    System.out.println("Cannot send email as an error occurred.");
    e.printStackTrace();
    catch(Exception e) {
    System.out.println("Host " + SMTP_SERVER + "unknown");
    e.printStackTrace();
    } finally {
    // close all of the data streams
    try {
    if(!smtpSocket.isClosed()) {
    smtpSocket.close();
    smtpSocket = null;
    } catch(Exception e) {
    e.printStackTrace();
    try {
    if(os != null) {
    os.close();
    os = null;
    } catch(Exception e) {
    e.printStackTrace();
    try {
    if(is != null) {
    is.close();
    is = null;
    } catch(Exception e) {
    e.printStackTrace();
    i have used an example on the web to help me do this, so it may look familiar!!
    It works fine when i run the program in debug mode but doesn't work when i run the jar file, i was wondering if anyone could help me understand why? or give me a clue as to where to look as i have had the strange realisation that i rarely compile my code up to be used by other people!!
    sad but true! Also apologies if i haven't posted adequate information, this is the first time i have posted on the forum asking for help!
    Anyway help would be most appreciated and thanks in advance

    Sorry, by debug mode i mean running it using netbeans 5.5 and clicking on the "run main project" icon.
    Once i have cleaned and built the main project all of the files are put into the jar file. Once i have done that i double click on the jar icon
    is that ok? there doesn't seem to be any errors

  • How can I share a *.java source file across multiple projects in NetBeans?

    I'm sure this simple and a pretty common operation but how can I share a *.java source file across multiple projects in NetBeans? Right now I keep cut, coping and pasting the same source file between multiple projects to re-use the same code. But I could I make this source file a library file or something like that so that I could access it from any project. I assume this would be a generic operation but I mentioned NetBeans for clarity. Thanks.

    fiebigc wrote:
    I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    >I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    Create a class library.
    Write your code, compile it to .class files, put those class files in a .jar file and include the jar file in the classpath whenever you want to compile a project against it.

  • COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET: US$20 AWARD FOR SOLUTION!

    COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET PROBLEM (Easy Filter Java Applet) -
    US$20 TO ANYONE WHO CAN RESOLVE THE PROBLEM
    To forum visitors:
    I am prepared to pay a standard shareware fee of US$20 to a user who can resolve this technical problem.
    If your advice resolves the problem, I'll forward the payment to your postal address (include your
    address with your reply, and also your email address)
    I am attempting to enable a HTML button (using Javascript's onClick command) to directly input a number into one of the parameter text boxes in the Easy Filter Java applet (ie, enter a new color value number in the text field of the standard Colors Multiplicator Filter interface).
    The applet is Freeware and can be downloaded at: http://www.javazoom.net/applets/easyfilter10/EasyFilter10.html
    (It is a very effective bitmap display and editing utility)
    To achieve this, I am trying to access the part of the applet that defines and sets the textbox. The text box is defined in the .class file by accessing the parameter details in the genericfilter.txt file (accompanies the .class files). I need to access 'private String appletInitialize()' and then one of the 'textFieldParameters' which sets the textbox.
    I understand the basic syntax for referencing the applet:
    document.appletname.setString("An example"). However, accessing the text fields in this applet is more complex!!
    Please can you recommend the correct Javascript syntax to achieve communication with the applet.
    Thank you for your kind assistance.
    JM Graham
    [email protected]
    The Java source code for the applet: EasyFilter.class
    # Easy Filter - E.B/JavaZOOM 1999 #
    # Contact: [email protected] #
    # http://javazoom.hypermart.net #
    /* Originally compiled from EasyFilter.java */
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.applet.Applet;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.image.MemoryImageSource;
    import java.awt.image.PixelGrabber;
    import java.util.Vector;
    public synchronized class EasyFilter extends Applet implements KeyListener
    private String paramFileName;
    private Color bgColor;
    private Color fgColor;
    private Color parColor;
    private Color sepColor;
    private Color titleColor;
    private Color helpColor;
    private int WinWidth;
    private int WinHeight;
    private String title;
    private String logoFileName;
    private String originalImageFileName;
    private String filteredCaption;
    private String originalCaption;
    private Vector paramsName;
    private Vector paramsValue;
    private Vector paramsComment;
    private Panel panelParameters[];
    private Label labelParameters[];
    private TextField textFieldParameters[];
    private Label labelComments[];
    private int nbParameters;
    private ScrollPane scrollPaneParams;
    private Panel panelParams;
    private Image theLogo;
    private Image theOriginalImage;
    private Image theFilteredImage;
    private int theOriginalPixelArray[];
    private int logoWidth;
    private int logoHeight;
    private int imageWidth;
    private int imageHeight;
    private drawCanvas canvasTitle;
    private Panel panelTitle;
    private Label labelTitle;
    private Panel panelImages;
    private Panel panelOriginalImage;
    private drawCanvas canvasOriginalImage;
    private Label labelOriginalImage;
    private Panel panelFilteredImage;
    private drawCanvas canvasFilteredImage;
    private Label labelFilteredImage;
    private Panel panelHelp;
    private Label labelHelp;
    private int Yspc;
    private FilterImplementation theFilter;
    public void init()
    String string = null;
    string = appletInitialize();
    setBackground(bgColor);
    if (string != null)
    removeAll();
    setBackground(Color.white);
    setForeground(Color.black);
    Label label = new Label(new StringBuffer("Error: ").append(string).toString(), 1);
    Panel panel = new Panel();
    panel.add(label);
    add(panel);
    setLayout(new FlowLayout(1, 5, Yspc));
    public void keyPressed(KeyEvent keyEvent)
    panelHelp.removeAll();
    boolean flag = true;
    if (KeyEvent.getKeyText(keyEvent.getKeyCode()).equals("Enter"))
    for (int i = 0; i < nbParameters; )
    try
    paramsValue.setElementAt(new Double(textFieldParameters.getText()), i);
    i++;
    catch (NumberFormatException e)
    labelHelp.setText(labelParameters[i].getText() + ": Not a Number");
    flag = false;
    break;
    if (flag == 1)
    labelHelp.setText(" .... Running, please wait .... ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    theFilter.updateParameters(paramsValue);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    canvasFilteredImage.repaint();
    panelHelp.removeAll();
    labelHelp.setText("- Done -");
    else
    labelHelp.setText("- Press Enter to run the Filter -");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    public void keyReleased(KeyEvent keyEvent)
    public void keyTyped(KeyEvent keyEvent)
    private String appletInitialize()
    WinWidth = size().width;
    WinHeight = size().height;
    if (getParameter("bgcolor") == null)
    bgColor = new Color(0, 0, 40);
    else
    bgColor = new Color(Integer.parseInt(getParameter("bgcolor"), 16));
    if (getParameter("fgcolor") == null)
    fgColor = new Color(255, 255, 255);
    else
    fgColor = new Color(Integer.parseInt(getParameter("fgcolor"), 16));
    if (getParameter("sepcolor") == null)
    sepColor = new Color(158, 128, 128);
    else
    sepColor = new Color(Integer.parseInt(getParameter("sepcolor"), 16));
    if (getParameter("parcolor") == null)
    parColor = new Color(24, 24, 24);
    else
    parColor = new Color(Integer.parseInt(getParameter("parcolor"), 16));
    if (getParameter("titlecolor") == null)
    titleColor = new Color(255, 255, 0);
    else
    titleColor = new Color(Integer.parseInt(getParameter("titlecolor"), 16));
    if (getParameter("helpcolor") == null)
    helpColor = new Color(0, 255, 255);
    else
    helpColor = new Color(Integer.parseInt(getParameter("helpcolor"), 16));
    paramsName = new Vector();
    paramsValue = new Vector();
    paramsComment = new Vector();
    paramFileName = getParameter("paramfile");
    String string = readParams(paramFileName);
    if (string != null)
    return string;
    MediaTracker mediaTracker = new MediaTracker(this);
    theOriginalImage = getImage(getDocumentBase(), originalImageFileName);
    mediaTracker.addImage(theOriginalImage, 0);
    if (logoFileName != null)
    theLogo = getImage(getDocumentBase(), logoFileName);
    mediaTracker.addImage(theLogo, 1);
    try
    mediaTracker.waitForAll();
    catch (InterruptedException e1)
    return "Error while loading image";
    if (mediaTracker.isErrorAny())
    return "Error while loading image";
    if (logoFileName != null)
    logoWidth = theLogo.getWidth(this);
    logoHeight = theLogo.getHeight(this);
    imageWidth = theOriginalImage.getWidth(this);
    imageHeight = theOriginalImage.getHeight(this);
    theOriginalPixelArray = new int[imageWidth * imageHeight];
    PixelGrabber pixelGrabber = new PixelGrabber(theOriginalImage, 0, 0, imageWidth, imageHeight, theOriginalPixelArray, 0, imageWidth);
    try
    pixelGrabber.grabPixels();
    panelTitle = new Panel();
    canvasTitle = new drawCanvas();
    labelTitle = new Label();
    panelTitle.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelTitle);
    panelTitle.setBackground(bgColor);
    panelTitle.add(canvasTitle);
    canvasTitle.setImage(theLogo);
    canvasTitle.setBounds(0, 0, logoWidth, logoHeight);
    labelTitle.setText(title);
    catch (InterruptedException e2)
    return "Internal Error, Try RELOAD !";
    if (title != null)
    panelTitle.add(labelTitle);
    labelTitle.setForeground(titleColor);
    labelTitle.setFont(new Font("Dialog", 1, 14));
    panelImages = new Panel();
    panelOriginalImage = new Panel();
    canvasOriginalImage = new drawCanvas();
    labelOriginalImage = new Label();
    panelFilteredImage = new Panel();
    canvasFilteredImage = new drawCanvas();
    labelFilteredImage = new Label();
    panelImages.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelImages);
    panelImages.setBackground(bgColor);
    panelOriginalImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelOriginalImage);
    panelOriginalImage.setBackground(Color.black);
    panelOriginalImage.add("Center", canvasOriginalImage);
    canvasOriginalImage.setImage(theOriginalImage);
    canvasOriginalImage.setBounds(0, 0, imageWidth, imageHeight);
    labelOriginalImage.setText(originalCaption);
    labelOriginalImage.setAlignment(1);
    panelOriginalImage.add("South", labelOriginalImage);
    labelOriginalImage.setBackground(Color.lightGray);
    labelOriginalImage.setForeground(Color.black);
    labelOriginalImage.setFont(new Font("SansSerif", 0, 10));
    panelFilteredImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelFilteredImage);
    panelFilteredImage.setBackground(Color.black);
    panelFilteredImage.add("Center", canvasFilteredImage);
    theFilter = new FilterImplementation(paramsValue, theOriginalPixelArray, imageWidth, imageHeight);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    labelFilteredImage.setText(filteredCaption);
    labelFilteredImage.setAlignment(1);
    panelFilteredImage.add("South", labelFilteredImage);
    labelFilteredImage.setBackground(Color.lightGray);
    labelFilteredImage.setFont(new Font("SansSerif", 0, 10));
    scrollPaneParams = new ScrollPane(0);
    panelParams = new Panel();
    nbParameters = paramsName.size();
    int i = WinHeight - (33 + 7 * Yspc + logoHeight + imageHeight + 23);
    if (i < Yspc + 2 + 24)
    i = Yspc + 2 + 24;
    scrollPaneParams.setBounds(0, 0, WinWidth - 10, i);
    panelParams.setLayout(new GridLayout(nbParameters, 1, 5, Yspc / 2));
    scrollPaneParams.add(panelParams);
    panelParams.setBackground(sepColor);
    panelParameters = new Panel[nbParameters];
    labelParameters = new Label[nbParameters];
    textFieldParameters = new TextField[nbParameters];
    labelComments = new Label[nbParameters];
    for (int j = 0; j < nbParameters; j++)
    panelParameters[j] = new Panel();
    panelParameters[j].setLayout(new FlowLayout(0, 5, 1));
    panelParams.add(panelParameters[j]);
    panelParameters[j].setBackground(parColor);
    labelParameters[j] = new Label();
    labelParameters[j].setText((String)paramsName.elementAt(j));
    panelParameters[j].add(labelParameters[j]);
    labelParameters[j].setForeground(fgColor);
    labelParameters[j].setFont(new Font("Dialog", 1, 12));
    textFieldParameters[j] = new TextField(8);
    textFieldParameters[j].setText(paramsValue.elementAt(j).toString());
    panelParameters[j].add(textFieldParameters[j]);
    textFieldParameters[j].setBackground(fgColor);
    textFieldParameters[j].addKeyListener(this);
    labelComments[j] = new Label();
    labelComments[j].setText((String)paramsComment.elementAt(j));
    panelParameters[j].add(labelComments[j]);
    labelComments[j].setForeground(fgColor);
    add(scrollPaneParams);
    panelHelp = new Panel();
    labelHelp = new Label();
    panelHelp.setLayout(new FlowLayout(1, 5, 0));
    add(panelHelp);
    panelHelp.setBackground(bgColor);
    labelHelp.setText(" Change colour values and press enter ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    labelHelp.setForeground(helpColor);
    return null;
    private String readParams(String string1)
    Object object1;
    String string2;
    if (string1 == null)
    return "Filename of filter's parameters needed";
    try
    URL uRL = new URL(getDocumentBase(), string1);
    URLConnection uRLConnection = uRL.openConnection();
    uRLConnection.setDoInput(true);
    uRLConnection.setUseCaches(false);
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream()));
    string2 = null;
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    if (bufferedReader != null)
    Object object2;
    try
    for (object2 = bufferedReader.readLine(); object2 != null && string2 == null; object2 = bufferedReader.readLine())
    string2 = extractFormat(object2);
    catch ()
    string2 = object2.getMessage();
    finally
    bufferedReader.close();
    if (string2 != null)
    return string2;
    else
    return null;
    private String extractFormat(String string1)
    if (string1.length() == 0)
    return null;
    int i = 0;
    int j = string1.indexOf(" ", i);
    if (j == -1)
    return "Bad format error (space missing)";
    String string2 = string1.substring(i, j);
    if (string2.equals("TITLE"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    title = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    originalCaption = string1.substring(i, j);
    return null;
    if (string2.equals("FILTEREDCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    filteredCaption = string1.substring(i, j);
    return null;
    if (string2.equals("LOGO"))
    i = j + 1;
    j = string1.length();
    logoFileName = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALIMAGE"))
    i = j + 1;
    j = string1.length();
    originalImageFileName = string1.substring(i, j);
    return null;
    if (!string2.equals("PARAM"))
    return null;
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    paramsName.addElement(string1.substring(i, j));
    i = j + 2;
    j = string1.indexOf(32, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    try
    paramsValue.addElement(new Double(string1.substring(i, j)));
    j = string1.indexOf(34, i);
    catch (NumberFormatException e)
    return "Bad format in a PARAM line";
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    paramsComment.addElement(string1.substring(i, j));
    return null;
    public EasyFilter()
    logoHeight = 33;
    Yspc = 5;

    Addition to my above submission
    To clarify, I'll offer the US$20 to the FIRST person who offers me a workable solution to the problem, not to everyone!!!
    JMGRAHAM

  • I need to know the right tools and java technology

    Please help,I need to know the right tools and java technology to support what I need.
    I had background programming in Assembly,C++,Visual Basic,SAP/ABAP 4.
    All I can say, programming is about logic, now we are very helped building program using objects.
    I'm very interest to SAP tech, where all screens, programs, reports are resides on tables, this is the real dynamic!
    CUrrently I'm eager to do the same technic with java. I'm new to java....
    What I know the J2EE is the core for me to start is it right? I was very interest with the Client-Server Tech. How can I impelemet this with Java?
    I'm a bit confuse with so many java solutions. There is Java Applets, Swing, Java AWT, JavaBeans, etc...
    I don't know what is the best if I want my Presentation/Client Application will run within browser (not standard html, using like windows gui). What should I do to make business logic objects, how to invoke it within the gui. how to make installation package whenever clients connect to the http server.
    if you have a pointer to do it please let me know.... I'm very appreciate all your response...
    Best regards,
    Lucky Pangemanan

    I'd say - don't get carried away with the heavyweight frameworks. Don't use EJB if Hibernate and/or Tomcat will do the job. There's a danger of winding up using a bulldozer to crack a wallnut.
    What people mean by "J2EE" varies a fair bit.
    Start with Tomcat, which has the virtue of being free. Try some JSPs and servlets.
    Use Applets to do client side presentation only if you must; Applets create an installation overhead on end-users, and some of them can't cope, while others may not have the necessary installation permissions on their office machines. They are pretty rarely needed, IMNSHO, most client-side behaviour is better handled with html and JavaScript.

  • Need Expert Advice regarding oracle and java objects

    In our project, we are submitting data for many screens at a time. Some screens will have a list of records to be submitted. There is also some hierarchy among the data up to 4 levels.
    In such a scenario, we need to know the best way to exchange data between Oracle and Java. Currently java holds the data as objects, where each object may contain an array of next level of objects in it.
    Is it best approach to pass the entire data with hierarchy to Oracle using nested table approach and internally oracle handling the data? Is there any other way to do this?
    Also in some scenarios we need to pass the entire information for all the screens in one shot with the hierarchy. So we need to know a solution for that also. Could you please help us in this regard?

    See Oracle JPublisher technique to map Oracle object types to Java ones:
    http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96658/toc.htm
    Rgds

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi,
    Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
    I have seen the Documents. But i couldn't able to understand it correctly.
    I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
    Is that possible to Create a Java class in the oracle Database itself ?.
    Where are the files located for the existing Java Class ?..
    Help Needed Please.
    Thanks,
    Murali.v

    Hi Murali,
    Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
    Configure deployment to a database to upload the java file instead of class
    The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
    Hope this helps,
    Sunil..

Maybe you are looking for

  • Finder not working properly..

    Hello, Since a week or two, my Finder is really bugging a lot. I'll give you a few examples: When I try to open my external HD in Finder, it looks like it's empty, after a few tries and a few minutes, all the folders that are on the HD show up. If I

  • Occaisional kernel panics: Panic log included

    Hey, I'm getting kernel panics when I have a lot of programs open, but while I still have plenty of inactive memory left per Activity Monitor. It may happen with several Firefox windows open, but it seems like it happens when there are less than a do

  • Scrolling in Photo Events List for iPod Syncing

    I'd like to know if this is a iTunes-wide bug or simply something on my computer. When on the Photos pane for iPod Touch syncing, there is a box for Events. Scrolling this list of Events on my touchpad only works horizontally, not up/down, though the

  • Encode URL

    Hi! i'm sending a html email with the following link: View Booking Reply"; is there anyway that i can encode the bookingID ?? Thanks!!!

  • Losting the photos in iCloud..Can I get them back ??

    I got the new iPhone and back up all the photos to iCloud from my old iPhone. However, I dont know that there is 30 days rules. So, I didnt save all of my iClouds photo to my new phone. And few days ago, I found that all of my photos were gone from t