New to sockets. How to implement multithreaded servers?

I have been reading the JAVA tutorial, but can't get a simple "echo" threaded server working here:
EchoServerThread.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
public class EchoServerThread extends Thread{
     private Socket s;
     public EchoServerThread(Socket socket){
          super("EchoServerThread");
          this.s=socket;
     public void run(){
          try {
               PrintWriter out = new PrintWriter(s.getOutputStream(),true);
               BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
               String rline;
               while((rline=in.readLine())!=null){
                    /*if(rline.equalsIgnoreCase("exit")) {
                         out.println("exit");
                         break;
                    out.println(rline);
               in.close();
               out.close();
               s.close();
          } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
}EchoServer.java
import java.io.IOException;
import java.net.ServerSocket;
public class EchoServer {
     public static void main(String[] args) {
               ServerSocket ssoc = null;
               try {
                    ssoc = new ServerSocket(4444);
               } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
               while(true)
                    try {
                         new EchoServerThread(ssoc.accept()).run();
                    } catch (IOException e) {
                         // TODO Auto-generated catch block
                         e.printStackTrace();
}EchoClient.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
public class EchoClient {
     public static void main (String [] args){
          try {
               Socket soc = new Socket("localhost",4444);
               PrintWriter out = new PrintWriter(soc.getOutputStream(),true);
               BufferedReader in = new BufferedReader(new InputStreamReader(soc.getInputStream()));
               BufferedReader stdIn= new BufferedReader(new InputStreamReader(System.in));
               String rline;
               while((rline=stdIn.readLine())!=null){
                    out.println(rline);
                    //System.out.println("written: "+rline);
                    /*String fromServer = in.readLine();
                    if(fromServer.equals("exit")){
                         System.out.println("Server is going down....");
                         System.out.println("fuck");
                         break;
                    else{*/
                    System.out.println("echo: "+in.readLine());
               in.close();
               out.close();
               stdIn.close();
               soc.close();
          } catch (UnknownHostException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
               System.exit(1);
          } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
               System.exit(2);
}What happens, is that the server only accepts another connection after a client dies. If I do some input on the 2nd opened client ( the 1st is still beeing served) it produces no output until the 1st one ends, then it produces all the correct output.

Hi,
it's just an idea that has come to my mind rigth now while eating my pizza, probably a big mistake. You could try to flush the BufferedReader cause maybe it remains blocked in this while((rline=in.readLine())!=null){
     /*if(rline.equalsIgnoreCase("exit")) {
          out.println("exit");
          break;
     out.println(rline);
}while loop. Just an idea though, probably it's wrong!
JoY?TiCk

Similar Messages

  • How RMI implements multithreading in Server-side?

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it.
    Could anyone give me some hint? Thanks!

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    The status of that site is zero. All you can rely on is the RMI specification.
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."That accurately describes the Sun implementation of RMI as of 1.5, the latest source code I have looked at. It doesn't accurately describe the IBM implementation nor I suspect the Sun 1.6 implementation.
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it. So? Why does it matter? The RMI specification tells you what the multi-threading guarantees of RMI are. They are all you can rely on.

  • Data socket. how to implement this?

    I need to write to a data socket server using a program that scans a multiple channel data logger. Up to 2 scans can be enabled and the scans run at selectable times and on selectable channels. For example, scan 1 might scan channels 0 to 19 at a two second interval and scan 2 might scan channels 20 - 99 at a 10 second interval. I would like to know the best way to implement the ds server so each scan will write it's own data at different times and they will not overwrite or otherwise interfer with one another. Possible?  Various seperate programs will access this data from the server and update their front panels as the new data is written to the ds server.  In the above example, my reader program which executes every 50 ms would update channels 0-19 every 2 seconds and channels 20-99 every 10 seconds.  Is it possible to open two ds servers using one for each scan? I've played with that without success.  I looked at the data socket server manager but couldn't determine if changing it would address my problem.  I'm using LV8.5.1 and the programs will be compiled to executables for running on multiple computers in the lab.  Thanks for any advice.  Hope this makes sense. 

    Hi Mike,
    You only have one DataSocket server available to you at a time.  You can write to a server from multiple locations, but you cannot have multiple servers.  You should be able to implement your idea in your code by alternating between write locations.  You would have to stagger the scans so that they don't overlap however.  Here are a couple of links that you might find useful:
    Configuring a DataSocket Server
    http://zone.ni.com/devzone/cda/tut/p/id/3123
    Can Multiple DataSocket Writers Connect to the Same Item?
    http://digital.ni.com/public.nsf/websearch/A8AC9A7​51404BAB18625672400630A3D?OpenDocument
    Nick Keel 
    Applications Engineering 
    National Instruments
    Nick Keel
    Product Manager - NI VeriStand and Model Interface Toolkit
    National Instruments

  • In how many ways we can create new document and how to implements this ways?

    I found that we can create new document by 3 ways
    1)by using session object of application ,document list as follow
    InterfacePtr<IApplication> firstdoc(GetExecutionContextSession()->QueryApplication());
              InterfacePtr<IDocumentList> docList(firstdoc->QueryDocumentList());
      docList->NewDoc(25089,IDataBase::ProtectionLevel.kProtectSave, nil);
    but in this case i am not getting how to use newdoc method i.e which parameter we have to pass(not even clear from API reference )
    2)by using command
    InterfacePtr<IApplication> firstdoc(GetExecutionContextSession()->QueryApplication());
              InterfacePtr<IDocumentList> docList(firstdoc->QueryDocumentList());
      InterfacePtr<ICommand> new1(CmdUtils::CreateCommand(kNewDocCmdBoss));
              UIDList asd(docList);
              new1->SetItemList(asd);
              CmdUtils::ProcessCommand(new1);
    3)bu using some util or facade interface
    Utils<IDocumentCommands>()->New( . . .)
    in this case also  i am not geeting how to use new method 
    I try all this method but none of them working .i knew i am doing some mistake  in all these method so please correct me where i am wrong .
    Main problem is in the first parameter of newdoc method i.e what is class id how to use them 

    1. add to your project "SDKLayoutHelper.cpp", "SDKLayoutHelper.h"
    2. #include "SDKLayoutHelper.h"
    insert code:
    do{
             SDKLayoutHelper helper;
             UIDRef docRef = helper.CreateDocument();
             if (UIDRef::gNull == docRef)
                 break;
             helper.OpenLayoutWindow(docRef);
        }while(kFalse);
    Regards!

  • How do the application servers connect the new database after failing over from primary DB to standby DB

    How do the application servers connect the new database after failing over from primary DB to standby DB?
    We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application team would like to know:
    When the primary DB server is crashed, the standy DB server will takeover the role of primary DB through the DataGuard fast failover. As the applications are connected by the primary DB IP before,currently the physical DB is used as a different IP or listener. If this is happened, they need to stop their application servers and re-configure their connection so the they coonect the new DB server, they cannot tolerate these workaround. 
    Whether does oracle have the better solution for this so that the application can automatically know the role's transition and change to the new IP without re-confige any connection and shutdown their application?
    Oracle support provides us the answer as following:
    ==================================================================
    Applications connected to a primary database can transparently failover to the new primary database upon an Oracle Data Guard role transition. Integration with Fast Application Notification (FAN) provides fast failover for integrated clients.
    After a failover, the broker publishes Fast Application Notification (FAN) events. These FAN events can be used in the following ways:
    Applications can use FAN without programmatic changes if they use one of these Oracle integrated database clients: Oracle Database JDBC, Oracle Database Oracle Call Interface (OCI), and Oracle Data Provider for .NET ( ODP.NET). These clients can be configured for Fast Connection Failover (FCF) to automatically connect to a new primary database after a failover.
    JAVA applications can use FAN programmatically by using the JDBC FAN application programming interface to subscribe to FAN events and to execute event handling actions upon the receipt of an event.
    FAN server-side callouts can be configured on the database tier.
    FAN events are published using Oracle Notification Services (ONS) and Oracle Streams Advanced Queuing (AQ).
    =======================================================================================
    Who has the experience and the related documentation or other solutions? we don't have the concept of about FAN.
    Thank very much in advance.

    Hi mesbeg,
    Thanks alot.
    For example, there is an application JBOSS server connecting the DB, we just added another datasource and put the standby IP into the configuration file except adding a service on DB side like this following:
            <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                    <datasource jta="false" jndi-name="java:/jdbc/idserverDatasource" pool-name="IDServerDataSource" enabled="true" use-java-context="true">
                        <connection-url>jdbc:oracle:thin:@<primay DB IP>:1521:testdb</connection-url>
                        <connection-url>jdbc:oracle:thin:@<standby DB IP>:1521:testdb</connection-url>
                        <driver>oracle</driver>
                        <pool>
                            <min-pool-size>2</min-pool-size>
                            <max-pool-size>10</max-pool-size>
                            <prefill>true</prefill>
                        </pool>
                        <security>
                            <user-name>TEST_USER</user-name>
                            <password>Password1</password>
                        </security>
                        <validation>
                            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
                            <validate-on-match>false</validate-on-match>
                            <background-validation>false</background-validation>
                            <use-fast-fail>false</use-fast-fail>
                            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
                            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
                        </validation>
                    </datasource>
                    <drivers>
                        <driver name="oracle" module="com.oracle.jdbc">
                            <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
                        </driver>
                    </drivers>
                </datasources>
            </subsystem>
    If the failover is occurred, the JBOSS will automatically be pointed to the standby DB. Additional actions are not needed.

  • How to implement this? please help

    In my java class, I have a string array called strarray which hold serveral elements, some of the elements have the same value , for example, the first element is "swimming", the forth element is also swimming. I use a for loop to get each element and give it to arrayHolder which is also a array with the same size as strarray. Now, what I want is: I defined a Vector called element I want this vector to filter out the element from arrayHolder, get the name of non-duplicated name from the arrayHolder, the result should be inside the element vector (swimming,walking,running,dancing), no duplicated name. My code is like follows:
    import java.util.*;
    import java.io.*;
    public class arrayTest{
    public static void main(String arg[]){
    String[] strarray={"swimming","running","walking","swimming","dancing","running"};
    String[] arrayHolder=new String[strarray.size];
    Vector element=new Vector();
    for(int i=0;i<strarray.length();i++){
    arrayHolder[  i  ]=strarray[  i  ];
    /* What should I do next to get the non-duplicated element from arrayHolder and
    * add them into the element vector????
    I did not finnish it, since I am a little bit confused, how to implement? Need some help. thanks.
    Message was edited by:
    Mellon

    Not sure if I see the use of strArray & arrayHolder (I've not looked at your code - you might use code tags next time (check the "code" button above the message textarea), but may I suggest using a Map of some sort instead of a Vector? It will prevent duplicates for you.
    Good Luck
    lee

  • How to Implement HTTP Request Status Code Processing

    I actually have two questions. First, I wondering how to add multiple status code processing to an http request. Secondly, I was wondering how to go about using alternate http requests to different servers in case the primary server is down. What kind of parameter would the program use to determine that the server is unavailable and switch to another server??
    Currently, the program I've written calls an rdf server (http://www.rdfabout.com/sparql) using a sparql query,
    the server returns an xml string, the program parses it, and calculates numbers
    from the string. The program works, but the problem is that the server is down occasionally.
    When the server is down, we need to add calls to another server to
    increase reliability. So, the next task is to call this server:
    http://www.melissadata.com/lookups/ZipDemo2000.asp
    I need to do exactly the same things I did with the rdf server. The
    difference will be constructing a request and a bit different parsing of
    the response.
    current SPARQL query is defined as follows:
    PREFIX dc:  <http://purl.org/dc/elements/1.1/>
    PREFIX census: <http://www.rdfabout.com/rdf/schema/census/>
    PREFIX census1: <tag:govshare.info,2005:rdf/census/details/100pct/>
    DESCRIBE ?table WHERE {
    <http://www.rdfabout.com/rdf/usgov/geo/census/zcta/90292> census:details
    ?details .
    ?details census1:totalPopulation ?table .
    ?table dc:title "SEX BY AGE (P012001)" .
    }current HTTP Request is defined as follows:
    import java.net.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.io.*;
    import java.io.DataOutputStream;
    import java.io.BufferedReader;
    import java.io.StringReader;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.util.Scanner;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.util.Arrays; 
    public class MyConnection
         static Scanner sc = new Scanner(System.in);//allows user to input zipcode
        public static void main(String[] args) throws Exception
             int zip;//zipcode is declared as integer format
            //User defines zip through input
            //proceed to put SPARQL query into string, which is then used to call the server
            String requestPart1 =
            "query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
            String requestPart2 = "" + zip; // zipcode is transformed from int to string format and plugged into SPARQL query here
            String requestPart3 =
            "%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
            String response = "";
            URL url = new URL("http://www.rdfabout.com/sparql");//designates server to connect to
            URLConnection conn = url.openConnection();//opens connection to server
            // Set connection parameters.
            conn.setDoInput (true);
            conn.setDoOutput (true);
            conn.setUseCaches (false);
            // Make server believe we are form data…
            conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
            DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
            // Write out the bytes of the content string to the stream.
            out.writeBytes(requestPart1 + requestPart2 + requestPart3);
            out.flush ();
            out.close ();
            // Read response from the input stream.
            BufferedReader in = new BufferedReader (new InputStreamReader(conn.getInputStream ()));
            String temp;
            while ((temp = in.readLine()) != null)
                 response += temp + "\n";
            temp = null;
            in.close ();
            //parsing stuff is taken care of after here
    }What remains now is to:
    1) add status code processing: notify if the server is not available, ect.
    2) add ability to connect to additional server if primary server is down.
    I'm thinking an if/else statement, which I've tried a few different ways,
    but I don't quite know how to implement that...Also trying to add the
    status code processing/error handling, but I'm not sure how to do that
    for multiple/different errors, such as 404, 503, 504, ect.. try/catch statements?
    So yeah, just been scratching my head on this trying to figure out how to work it..
    If you can help me out on this, I've been going nuts trying to figure this out...

    I think your issue comes form the fact that you are not casting URLConnection to HttpURLConnection.
    Doing the cast would allow you to use getResponseCode() - among other methods - and test for a response different than 200.
    Read: [http://mindprod.com/jgloss/urlconnection.html|http://mindprod.com/jgloss/urlconnection.html]

  • How to implement a domain?

    Hi,
    1 virtual network(192.168.0.x/24). 1 subnet: 192.168.0.4 to 192.168.0.254. 2 DNS Servers: 192.168.0.4 and 100.75.116.100 (DNS address when a new VM is created).
    I have 10 VMs. 1 DC. By powershell the VMs has been set static IP addresses (the DC is 192.168.0.4)
    The VMs were domain joined.
    The problems are:
    very slow or null internet speed (when the VM is new, the internet speed is fast).
    domain joining using netbios name is impossible (need to use FQDN name for domain joining OK)
    when domain joining a VM, occurs the following error(first welcome message, the error message):
    The questions are:
    How to implement a domain and mantain fast internet?
    Is normal behavior the above error at domain joining?
    Thanks in advance!

    Hi
    Joining a domain should not affect your internet connection.
    Try removing the second DNS address and see if your machine joins the domain.
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to implement a persistent HTTP connection on client side...

    Sorry for the inconvenience everyone, but I could really use some help here since I am a total newbie to Java programming
    I am trying to implement a persistent HTTP connection on the client side with request pipelining. The way I understand it is that client requests will be sent to the server, which will reply to them back to back, and then the client will read them accordingly. But when I read the server responses, I get only the reply for the first request, and nothing further, when I actually expect it to give me as many responses as the number of requests I ussued. Here is a sample code illustrating what I am trying to do.
    ====================
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class HttpClient {
    public static String host = "www.somehost.com";
    public static int port = 80;
    public static String pathname = "/download.asp";
    public static String protocol = "http";
    public static ArrayList list;
    public static void main(String[] args) {
    Parser parser = new Parser();
    list = parser.getIDs();
    try {
    Socket socket = new Socket(host, port);
    InputStream from_server = socket.getInputStream();
    PrintWriter to_server = new PrintWriter(socket.getOutputStream());
    OutputStream to_file;
    to_file = new FileOutputStream("HTTP_response.txt", true);
    for(int i = 0; i < 3; i++)
    String s = (String)parser.getIDs().get(i);
    String filename = "/download.asp?id=" + s;
    to_server.print("GET " + filename + "\n\n");
    to_server.flush(); // Send it right now!
    //This response gives only  only the response to the first
    //request,....
    byte[] buffer = new byte[4096];
    int bytes_read;
    while((bytes_read = from_server.read(buffer)) != -1)
    to_file.write(buffer, 0, bytes_read);
    to_file.close();
    socket.close();
    catch (Exception e) {
    System.err.println(e);
    System.err.println("Usage: java HttpClient <URL> [<filename>]");
    }

    There are many things wrong with your code. Learn the HTTP protocol and you'll know what I mean.
    Here's a hint - you'r missing headers in your code.
    Some servers do not support keep-alive connections, nor do you request a keep-alive connection.
    Connection: keep-alive
    Use that header field and see what happends. Also, in your while-loop, you actually close the output file and the socket. Don't you think it may be hard for the server to respond to a client that closed the connection on it?
    1. You don't know HTTP
    2. You don't seem to know Java
    3. You don't seem to understand basic programming logic

  • How to use multithreading for asynchronous operation

    hi! i am really new to java, i want to improve the performance of my code, some suggested to implement asynchronous operation using multithreading. Please help me how to use multithreading for asynchronous operation. thanks in advance.

    http://java.sun.com/docs/books/tutorial/essential/threads/
    Note, however, that just making something multithreaded won't necessarily improve performance. You either need multiple CPUs or there needs to be some I/O going on that blocks while something else could be done--other I/O or computing.

  • New Mac Mini - How do i reinstall my copy of Mountain LIon from App Store?

    Hi All:
    I just bought a new Mac Mini running Mountain Lion. I want to clone an older system drive that had been running Snow Leopard onto my new Mini and then upgrade to Mountain Lion (I tried Migration Assistant first, but it didn't work correctly and I don't want to mess with it again).
    My question: once I have a working Snow Leopard install on my Mini, is it possible to upgrade back to the Mountain Lion OS it came with without paying for a new copy? How do I do that?
    Thanks!

    It isn't just the hard drive - there is firmware built in that will prevent you from booting wih Snow Leopard. If you do a search here, you'll find many threads trying to install an earlier OS than what the machine came with all with the same answer (unless the Mac was built right around the time of a new OS being introduced, then it is possible to be booted from both OS's). In this case, you'd be trying to go backwards by 2 versions. Also see here:
    http://support.apple.com/kb/HT2186?viewlocale=en_US
    And yes, if you use internet recovery and first erase the drive (available in Disk Utility within the recovery partition) and then reinstall the OS, it'll reinstall the OS on a blank drive and you can start over. If the machine is new, then Command + R during restart should automatically boot into internet recovery (connecting you to Apple's servers by showing a spinning globe while connecting); if the machine is a bit older, then Command + Option + R will boot into internet recovery.

  • Can't Figure Out How To Implement IEnumerable T

    I have no problem implementing IEnumerable but can't figure out how to implement IEnumerable<T>. Using the non-generic ArrayList, I have this code:
    class PeopleCollection : IEnumerable
    ArrayList people = new ArrayList();
    public PeopleCollection() { }
    public IEnumerator GetEnumerator()
    return people.GetEnumerator();
    class Program
    static void Main(string[] args)
    PeopleCollection collection = new PeopleCollection();
    foreach (Person p in collection)
    Console.WriteLine(p);
    I'm trying to do the same thing (using a List<Person> as the member variable instead of ArrayList) but get compile errors involving improper return types on my GetEnumerator() method. I start out with this:
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    throw new NotImplementedException();
    IEnumerator IEnumerable.GetEnumerator()
    throw new NotImplementedException();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();
    That code compiles (basically because I haven't really done anything yet), but I get compile errors when I try to implement the GetEnumerator() methods.

    The List<T> class implements the IEnumerable<T> interface, so your enumerator can return the GetEnumerator call from the list.
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    return myPeople.GetEnumerator();
    IEnumerator IEnumerable.GetEnumerator()
    return myPeople.GetEnumerator();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();

  • How to implement a java class in my form .

    Hi All ,
    I'm trying to create a Button or a Bean Area Item and Implement a class to it on the ( IMPLEMENTATION CLASS ) property such as ( oracle.forms.demos.RoundedButton ) class . but it doesn't work ... please tell me how to implement such a class to my button .
    Thanx a lot for your help.
    AIN
    null

    hi [email protected]
    tell me my friend .. how can i extend
    the standard Forms button in Java ? ... what is the tool for that ... can you explain more please .. or can you give me a full example ... i don't have any expereience on that .. i'm waiting for your reply .
    Thanx a lot for your cooperation .
    Ali
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Henrik, the Java importer lets you call Java classes on the app server side - I think what Ali is trying to do is integrate on the client side.
    If you want to add your own button then if you extend the standard Forms button in Java and then use this class name in the implementation class property then the Java for your button will be used instead of the standard Forms button. And since it has extended the basic Forms button it has all the standard button functionality.
    There is a white paper on OTN about this and we have created a new white paper which will be out in a couple of months (I think).
    Regards
    Grant Ronald<HR></BLOCKQUOTE>
    null

  • How to implement reading data from a mat file on a cRIO?

    Hi all!
    I am not even sure, this is plausible, but I'd rather ask before i start complicating. So far, I have not found any helpful info about reading in data to a RT device from a file (kind of a simulation test - the data is simulated). 
    I have the MatLab plugin that allows the data storage read a MAT file, which has a number of colums representing different signals and lines representing the samples at a given time (based on the sample time - each sample time has it's own line of signal data). 
    I have no idea of how to implement this to cRIO.
    The idea is:
    I have some algorithms that run on the RIO controller in a timed loop. As the inputs to these algorithms, i would need to acces each of the columns values in the line, that corresponds to the sample time (kind of a time series - without the actual times written).
    I am fairly new to RT and LV development, so any help would be much appreciated.
    Thanks, 
    Luka
    Solved!
    Go to Solution.

    Hi Luka!
    MAT file support in LabVIEW is handled by DataPlugins. Here you can find the MATLAb plugin:
    http://zone.ni.com/devzone/cda/epd/p/id/4178
    And here you can find information on how to use DataPlugins to read or write files of a certain format:
    http://www.ni.com/white-paper/11951/en
    There is also an open-source project that addresses the problem, you can find it at
    http://matio-labview.sourceforge.net/
    Unfortunately, RT systems are not supported by DataPlugins, so fist you'll have to write a VI on the Host computer to convert your files to a usable format (I suggest TMDS for compactness and ease of use), and the work on the converted files in the cRIO VI. If you have other questions about DataPlugins or anything else, please get back to me.
    Best regards:
    Andrew Valko
    National Instruments
    Andrew Valko
    National Instruments Hungary

  • How to implement select all files (Ctrl-A) in open file dialog??

    I successfully created file open dialog. However, in most windows file open dialog,
    if you press "Ctrl-A," it will select all the files in the directory. If you press "Ctrl"
    key with arrow key, it will highligh the files you want. ie. It allows users to open
    more than one files at the same time. How to implement it in Java??

    For doing this, you have to enable the file multiselection.
    If you have created a JFileChooser as :
    JFileChooser fileChooser = new JFileChooser();
    Add the following statement to set the multiselection property.
    fileChooser.setMultiSelectionEnabled(true);
    Manish.

Maybe you are looking for

  • Problem: Creating Charts in RTF Templates

    I am using BI Publisher Template Builder for Word. I am using Word 2007 and the patch 9821068 of the Template Builder. I am attempting to create a chart in an rtf template using the chart wizard. I can go through the wizard fine and preview my chart

  • Is Apple Pro Res viewable on computers WITHOUT Final Cut installed?

    I have used Apple Pro Res to compress 3d animation and it looks great, far better than any codec so far. Now I find that it is only viewable on computers with Final Cut Pro 6 installed. I am planning to exhibit the work as quicktimes, but need to use

  • Local copy idisk folders added to sidebar disappear after restart

    Folders from a local idisk copy added to the finder sidebar continually disappear after restart. Any idea how to prevent this?

  • Plain raw format - DNG conversion

    Dear All, Would you guide me regarding to converting plain raw format file to DNG file? <definition> 1. plain raw format file - the file is composed of Bayer pixel array. For example, 5M pixel raw file is composed of sequential 2592 x 1920 pixels, ea

  • Downloading and Opening PhotoShop on Creative Cloud service

    I have and Adobe Account and User Name. I have downloaded the creative Cloud App and have ordered PhotoShop. I have updated the app in the Creative Cloud app, but that is all the farther I get. The Download of Photoshop just sits still? Is it because