I hava a class where the printout is in dos.....

I hava a class where the printout is in dos now I want it to print out itin a Gui application or applet instead how do I do.
Here is the class file:
import filenet.vw.api.*;
public class QueueSample extends Object
public QueueSample(VWSession vwSession, Logger logger, String queueName)
QueueHelper queueHelper = null;
VWQueue vwQueue = null;
try
logger.logAndDisplay("\n~ Starting QueueSample execution.");
queueHelper = new QueueHelper(vwSession, logger);
if (queueName != null)
vwQueue = vwSession.getQueue(queueName);
else
String[] queueNames = queueHelper.getQueueNames(false);
if (queueNames == null || queueNames.length == 0)
logger.log("No queues found.");
return;
else
// iteratively get queues until first one with available elements is found.
for (int i = 0; i < queueNames.length; i++)
vwQueue = vwSession.getQueue(queueNames);
if (vwQueue != null)
if (vwQueue.fetchCount() > 0)
break;
// clear our reference
vwQueue = null;
if (vwQueue == null)
logger.log("Unable to retrieve a queue!");
return;
else
// display the contents of the queue
queueHelper.displayQueueContents(vwQueue);
catch (Exception ex)
if (logger != null)
logger.log(ex);
else
ex.printStackTrace();
finally
if (logger != null)
logger.logAndDisplay("~ QueueSample execution complete.\n");
//{{INIT_CONTROLS
public static void main(String args[])
String queueName = null;
String fileName = null;
Logger logger = null;
SessionHelper sessionHelper = null;
VWSession vwSession = null;
QueueSample sampleClass = null;
try
// did the user supply enough arguments?
if (args.length < 3 || (args.length > 0 && args[0].compareTo("?") == 0))
System.out.println("Usage: QueueSample username password router_URL [queue_name] [output_file]");
System.exit(1);
// the queue name is optional
if (args.length > 3)
queueName = args[3];
// the file name (for output) is optional
if (args.length > 4)
fileName = args[4];
else
fileName = new String("QueueSample.out");
// create and initialize the logger
logger = new Logger(fileName);
// create the session and log in
sessionHelper = new SessionHelper(args[0], args[1], args[2], logger);
vwSession = sessionHelper.logon();
if (vwSession != null)
// create the sample class
sampleClass = new QueueSample(vwSession, logger, queueName);
catch (Exception ex)
if (logger != null)
logger.log(ex);
else
ex.printStackTrace();
finally
// logoff
if (sessionHelper != null)
sessionHelper.logoff();
}

I just created this "remote debugger" last week because I wanted to get runtime output from my servlets without having to resort to finding the server logs...scanning them...etc. It can also be used to log info locally. Here is the code for the screen logger:
package com.mycode.remotedebugger.applet;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
public class CRemoteDebugger extends JApplet implements Runnable{
   boolean isStandalone         = false;
   static ServerSocket m_socket = null;
   JScrollPane jScrollPane1     = new JScrollPane();
   static Thread runner         = null;
   static Socket connection     = null;
   BorderLayout borderLayout1   = new BorderLayout();
   JTextArea jTextArea1         = new JTextArea();
    * Constructs a new instance.
    * getParameter
    * @param key
    * @param def
    * @return java.lang.String
   public String getParameter(String key, String def) {
      if (isStandalone) {
         return System.getProperty(key, def);
      if (getParameter(key) != null) {
         return getParameter(key);
      return def;
   public CRemoteDebugger() {
    * Initializes the state of this instance.
    * init
   public void init() {
      try  {
         jbInit();
      catch (Exception e) {
         e.printStackTrace();
   public boolean isConnected()
      return m_socket != null;
   private void jbInit() throws Exception
      this.setSize(new Dimension(400, 400));
      this.getContentPane().add(jScrollPane1, BorderLayout.CENTER);
      jScrollPane1.getViewport().add(jTextArea1, null);
      runner = new Thread(this);
      runner.start();
   public void run()
      try {
         m_socket = new ServerSocket(6666);
         while(true)  {
            InetAddress ia = InetAddress.getLocalHost();
            connection = m_socket.accept();
            InputStream is = connection.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String strLine = br.readLine();
            while(strLine != null)  {
               jTextArea1.append(strLine + "\n");
               jTextArea1.setCaretPosition(jTextArea1.getDocument().getLength());
               strLine = br.readLine();
      } catch(Exception e)  {
    * start
   public void start() {
     setLookAndFeel();
    * stop
   public void stop() {
    * destroy
   public void destroy() {
    if(m_socket != null)  {
      try  {
         m_socket.close();
      } catch (IOException ioe)  {
      m_socket = null;
    if(runner != null)
      runner = null;
    if(connection != null)  {
      try {
         connection.close();
      } catch(IOException ioe)  {
      connection = null;
    * getAppletInfo
    * @return java.lang.String
   public String getAppletInfo() {
      return "Applet Information";
    * getParameterInfo
    * @return java.lang.String[][]
   public String[][] getParameterInfo() {
      return null;
    * main
    * @param args
   public static void main(String[] args) {
      CRemoteDebugger applet = new CRemoteDebugger();
      applet.isStandalone = true;
      JFrame frame = new JFrame();
      frame.setTitle("Remote Debugging");
      frame.getContentPane().add(applet, BorderLayout.CENTER);
      applet.init();
      applet.start();
      frame.setSize(400, 420);
      Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
      frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
      frame.setVisible(true);
      frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          if(m_socket != null)  {
             try  {
                m_socket.close();
             } catch (IOException ioe)  {
             m_socket = null;
          if(runner != null)
            runner = null;
          if(connection != null)  {
             try {
               connection.close();
          } catch(IOException ioe)  {
          connection = null;
           System.exit(0);
   void setLookAndFeel(){
      try {
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      catch(Exception e) {
         e.printStackTrace();
}I compiled this and put it into a jar file for easy running via a shortcut on my desktop.
Here is the static function you would put either in your application/applet or perhaps in some utility class that you import:
package com.mycode.common.utilities;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
public class RemoteDebugMessage
   static Socket m_socket            = null;
   static PrintWriter serverOutput   = null;
    * Constructor
   public static void Print(String strClient, int nPort, String strMessage)
      try {
         m_socket = new Socket(strClient,nPort);
         if(m_socket != null)  {
            OutputStream os = m_socket.getOutputStream();
            if(os != null)  {
               serverOutput = new PrintWriter(new BufferedOutputStream(m_socket.getOutputStream()),true);
               if(serverOutput != null)  {
                  serverOutput.println(strMessage);
      } catch(IOException ioe)  {
      try {
         m_socket.close();
         m_socket = null;
         serverOutput = null;
      } catch(IOException ioe)  {
}The "server" side listens on port 6666 (you can always change to whatever port you like and recompile) Then, in your code where you wish to watch messages in realtime, you call the static function above:
RemoteDebugMessage.Print("MachineName",6666,"This is my message!");

Similar Messages

  • First question - I have Acrobat 9 on my desktop and the license seems to have been messed up.  I tried to download and fis but I asked me for a disk.  I don't have any idea where the "disk" is.  Can I get the license update without that disk?

    First question - I have Acrobat 9 on my desktop and the license seems to have been messed up.  I tried to download and fis but I asked me for a disk.  I don't have any idea where the "disk" is.  Can I get the license update without that disk?
    Second question - In anticipation of not being able to do that, I bought (at University bookstore) Acrobat XI Pro - do I need to uninstall the 9.0 Pro version before I try to install the XI version?

    If you still have your serial number for Acrobat Pro there is a link to the installer here:  Download Acrobat products | 9, 8

  • I have to guess where the comma is the @ sign is and various signals now tell what am i doing wrong on the apple usb keyboard

    I have to guess where the comma is the @ sign is and various signals now tell what am i doing wrong on the apple usb keyboard

    Hello
    This can be verry usefull
    http://support.apple.com/kb/HT2841?locale=en_US
    How to identify keyboard localizations
    HTH
    Pierre

  • I have a situation where the administrator password is rejected when attempting a software update. I think this happened because of syncing a iPad to the iMac.  How can I reset the Software Update back to the administrator password?

    I have a situation where the administrator password is rejected when attempting a software update. I think this happened because of syncing an iPad to the iMac.  How can I reset the Software Update back to the administrator password?

    You can reset the password with the install disk.

  • HT201272 There is a TV series season that itunes  identifies as PURCHASED but will not download as it says it has already been downloaded but I have no idea where the initial download is. Anyone know how to fix this?

    There is a TV series season that itunes  identifies as PURCHASED but will not download as it says it has already been downloaded but I have no idea where the initial download is. Anyone know how to fix this?

    Cancel your storage upgrade
    If you upgrade or renew your storage but no longer need it, you can cancel. If you cancel your storage plan within 15 days of an upgrade or within 45 days after a yearly payment, you can contact Apple for a full refund. After this period, you can downgrade your storage for the following year.
    Note:  Partial refunds are available where required by law.
    From here  >  http://help.apple.com/icloud/?lang=en#mma3518f8580
    HelpKimIsAlreadyTaken wrote:
    Since I purchased about $70 worth of movies and books and they won't load onto my iPad, do you think iTunes will refund my money?
    If you make more room on your Device perhaps you can View/ use the purchases...
    However if you would prefer a Refund... you can always ask... be sure to explain your situation...
    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    Note:
    It is stated that all sales are final

  • I hava a class that's print out in dos now I want it....

    I hava a class that's print out in dos now I want it to print out in a Gui application or applet instead how do I do.
    Here is the class file:
    import filenet.vw.api.*;
    public class QueueSample extends Object
    public QueueSample(VWSession vwSession, Logger logger, String queueName)
    QueueHelper queueHelper = null;
    VWQueue vwQueue = null;
    try
    logger.logAndDisplay("\n~ Starting QueueSample execution.");
    queueHelper = new QueueHelper(vwSession, logger);
    if (queueName != null)
    vwQueue = vwSession.getQueue(queueName);
    else
    String[] queueNames = queueHelper.getQueueNames(false);
    if (queueNames == null || queueNames.length == 0)
    logger.log("No queues found.");
    return;
    else
    // iteratively get queues until first one with available elements is found.
    for (int i = 0; i < queueNames.length; i++)
    vwQueue = vwSession.getQueue(queueNames);
    if (vwQueue != null)
    if (vwQueue.fetchCount() > 0)
    break;
    // clear our reference
    vwQueue = null;
    if (vwQueue == null)
    logger.log("Unable to retrieve a queue!");
    return;
    else
    // display the contents of the queue
    queueHelper.displayQueueContents(vwQueue);
    catch (Exception ex)
    if (logger != null)
    logger.log(ex);
    else
    ex.printStackTrace();
    finally
    if (logger != null)
    logger.logAndDisplay("~ QueueSample execution complete.\n");
              //{{INIT_CONTROLS
    public static void main(String args[])
    String queueName = null;
    String fileName = null;
    Logger logger = null;
    SessionHelper sessionHelper = null;
    VWSession vwSession = null;
    QueueSample sampleClass = null;
    try
    // did the user supply enough arguments?
    if (args.length < 3 || (args.length > 0 && args[0].compareTo("?") == 0))
    System.out.println("Usage: QueueSample username password router_URL [queue_name] [output_file]");
    System.exit(1);
    // the queue name is optional
    if (args.length > 3)
    queueName = args[3];
    // the file name (for output) is optional
    if (args.length > 4)
    fileName = args[4];
    else
    fileName = new String("QueueSample.out");
    // create and initialize the logger
    logger = new Logger(fileName);
    // create the session and log in
    sessionHelper = new SessionHelper(args[0], args[1], args[2], logger);
    vwSession = sessionHelper.logon();
    if (vwSession != null)
    // create the sample class
    sampleClass = new QueueSample(vwSession, logger, queueName);
    catch (Exception ex)
    if (logger != null)
    logger.log(ex);
    else
    ex.printStackTrace();
    finally
    // logoff
    if (sessionHelper != null)
    sessionHelper.logoff();
    //Newbie

    I might sound stupid now but as far as I can gather you have a class that prints your exceptons out to dos. You would like to apply this class in an Application /Applet so that YOu can print out to a screen that you have designed. If that is the case just instantiate and intialize that class to the Application / Applet where you would like to display it. What is so difficult?
    getYourLabel/textarea.setText("Info that you wanted printed in gui / applet");
    //Don't use System.out.println('"...");Also another thing if it is what I suspect then you have to go and study your theory again.

  • I can't download movies.  I'm taking a cinema class where the professor provides a link to to a movie to be watched.  I am unable to access the link on my mac pro.  is there an app or software download that will allow me to do this?

    I can't download movies.  I'm taking a cinema class where I am required to watch movies.  My professor provides the link on an electronic blackboard for the movies.  I can't access the link on my mac pro notebook.  Is there an app or software download that can help with this?  I can access the link fine on a pc.

    The "right click" is a function of the OS and those keyboard commands do not work on the iPad at all with the built in virtual keyboard. I don't use an external keyboard - so I cannot attest to the possibility of that working - but there are no keyboard shortcuts with the iPad keyboard.

  • How to call a method of a class where the name of method is string

    i have a method of a class in the form of a string and i have the object of the class to which it belongs .what i want to do is call this method.
    for ex:
    S1 s=new S1();
    // this is the object of my class. this class has one method called executeMe()
    String methodname="executeMe";
    //i have the name of the method with me in the form of string.
    so how can i call the class's method in this scenario from the string like what should i write in sucha way that i get s.executeMe(); it is not presumed that this will only be the method that will be called. there maybe some other method too and it has also to be called this way. so please guide.

    S1 s = new S1();
    String name = "executeMe";
    Method m = s.getClass().getDeclaredMethod(name,null); // no parameters
    m.invoke(s,null);Built from memory, maycontain flaws.

  • Is it possible to have a section where the user can take notes?

    I want to create a iBook for my class to use on iPads.  Is there a way to create "Study Guide" where the user can type in notes or short answers?

    iBooks on iOS provides a notes feature built-in.
    You can investigate using an HTML Widget, but I wouldn't rely on it beyond sessions.

  • Why do I have chineese script where the tabs are?

    I have chineese looking black ink script that covers the top of the tabs making it impossible to see where the X is to close the tab.

    hi Akita0213, other affected users have tied this issue to a bug in the mcafee site advisor extension - please try to disable or remove that in case you have it present.
    http://service.mcafee.com/faqdocument.aspx?id=TS100162

  • I have a website where the masthead and other title fonts are defined in the CSS but Firefox shows the font as Times Roman. The website is correctly displayed in IE9, IE8, chrome and opera.

    The fonts, which have been described in the CSS file as:
    #content h1{background-color:transparent;border:0px;font-family:"Copperplate Gothic bold";font-size:1.75em;font-weight:normal;margin:0px 0px 10px 0px;padding:0px;}
    Display as Times Roman (I think).
    If i substitute a single word font name instead of : "Copperplate Gothic bold" such as: "Arial" it works ok.

    Do you see that font listed as one of the default fonts?
    * Tools > Options > Content : Fonts & Colors : Default font
    Do you see that font if you select it as the default?
    Reload web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)

  • I installed LabVIEW 5.1 on an XP machine and some of the VI's, such as fit to curve, do not have icons. Instead, they have a ? where the icon should be, and they cannot be inserted into my VI's. Can anyone fix this?

    I am using a Dell Inspiron I8100 Laptop with Windows XP Home and am running LabVIEW 5.1 in Windows 95 compatability [I also did so for the install to get rid of the "wrong os" message]. I am able to use nearly all of the functions, but a few of them did not make the transition to my machine. I cannot use some of the VI's contained in the Mathematics sub-palette, I cannot use some of the demos, and it is really setting me back. Instead of an icon for the Mathematics>>Curve Fit sub-palette I get a ? in an icon-sized box that says Curve Fit for it
    s description. Can anyone fix these broken links?
    Attachments:
    LabView.bmp ‏2731 KB
    labview2.bmp ‏2731 KB

    From your discussion I have seen that you try to use LV 5.1.
    It seems that 5.1.1 will work correct. The difference is that 5.1.1 is compatible with Win 2000 and 5.1 is not. This can by a issue.
    Another thing I have seen under Win2000 is the rights a user has. Since you use XP Home there should be no restrictions to the user of the machine. One thing to take into account is do you install and use LV as the same user?
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • I have an issue where the calendar server on my 10.8.4 machine all of a sudden got hung.  I get a message that says "Operation:  CalDavAccountRefreshQueueableOperation".  It is currently stuck in a "STARTING" status.  Has anyone seen this before?

    I have tried repairing permissions.  I have tried stopping the service both from the Server app and terminal.  I have searched and searched online and can't figure this out.  Any assistance is greatly appreciated!

    Hi there,
    You're running an old version of Safari. Before troubleshooting, try updating it to the latest version: 6.0. You can do this by clicking the Apple logo in the top left, then clicking Software update.
    You can also update to the latest version of OS X, 10.8 Mountain Lion, from the Mac App Store for $19.99, which will automatically install Safari 6 as well, but this isn't essential, only reccomended.
    Thanks, let me know if the update helps,
    Nathan

  • I have a class where I need to use SmartDraw but it is not compatible with Mac probook what are some other software programs I can use to make floorplans and building plans?

    I am suppose to download SmartDraw to my computer for a class but it is not compatible with Probook is there another program that does the same as SmartDraw?  I am planning a building addition and need it for the floor plans.  Any help would be greatly appreciated.

    There are lots of choices. Just go to the App Store and type in Cad Drawing in the search field. Also Sketchup from Google is a cloud based solution hat works pretty well.

  • I have a question: Wheres the Repeat function

    how can i get a album to be on repeat like on the other ipods? Is this function missing from the touch?

    a simple look in the manual would have revealed the answer:
    tap the album cover in while-playing-screen and the music playback controls appear.

Maybe you are looking for

  • HP LaserJet Pro MFP M435nw

    Dear sir,                I'am seenu working in system administrator for myproptree foundation pvt ltd. hp printer model number:HP LaserJet Pro MFP M435nw  Problem issue:              -scan option email option not working              -outlook mail co

  • Using ORDER BY in Oralce 7.3.x

    Hi, I need to create a view using ORDER BY cluase in Oralce 7.3.x. (I guess ORDER BY Clause is not supported in Oracle 7.3). Please Let me know any workaround for this. Thanks in advance. -Gopi

  • How to handle lsmw table control

    i have to update line items for tcode : v-45. through LSMW. please let me know how to handle multiple line items.

  • Play back saved project

    Hello: I am a new mac user (12months) I am having a problem with an IMovie project that I saved. I played it several times with no problem, now when I try to play it the clips skip and the audio track is not in sync. It almost appears as if there is

  • Insert records from datablock

    Hello Friends I have a datablock in tabular form now i want to put a few fields of multiple records to another table, But it should work while inserting,updating and deletion as well, I need complete procedure thanks to all;