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.

Similar Messages

  • Let's say I have a document that is 5 pages long. Now I want to insert the page numbers, starting on page 3 with the number "3" and leaving out pages 1 and 2. How do I do that?

    Let's say I have a document that is 5 pages long. Now I want to insert the page numbers, starting on page 3 with the number "3" and leaving out pages 1 and 2. How do I do that?

    I just found the answer myself. I don't know how to delete my question, so I'll just write the reply to the answer - just in case somebody needs to know: Insert a section brake after the second page and then choose "Start on 3".

  • I have 2 sons that were sharing one account and now I want to separate them, will I run into any issues ?

    I have twin sons and my wife sharing one itunes account and now from what a relative told me I should split them up since face time from my sons itouch is showing up on my wife's iphone ... so I started a new itunes account for all 3 of them, and now I want to sync each of their devices with their own accounts, before they had all the same music, etc... will I run into any issues when syncing each of their devices... meaning will I see a message like "this device is synced with another account and then it will say if I proceed it will erase what is on the device" ... ??  will I see this or will it just sync as normal
    Thanks

    You can't merge accounts or transfer iTunes purchases from one Apple ID to another: but there is no problem about using two IDs.
    Use your iCloud ID for iCloud for syncing email, contacts, calendars, bookmarks, and PhotoStream.
    Use your other Apple ID as before for iTunes, iTunes in the Cloud and iTunes Match.
    There's no conflict about doing this, and you won't even notice as Keychain will log you in with the correct ID in each case. It's also better security not to have your iTunes login also your email address, given the number of complaints about hacked iTunes accounts.

  • 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!");

  • I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    This can be the result of selecting the wrong driver. An older, unsupported laser printer will sometimes work with the generic Postscript driver.

  • Does java have any class that wrap byte[]

    my program would send byte[] to remote host;I know byte cant be serializabled;
    so I would a class wrap byte[],I cant write new class,because remote host maybe havent this class,
    I want to kown if java have a class that wrap byte[];

    The iPlanet Application Server 6.5 has a very nasty bug when you're using RMI/IIOP: if you want to reference an EJB in a stand-alone application. you can't use reliably methods that take parameters whose type is an array of primitives (like byte[]). The EJB can be called correctly in a Web application or by another EJB, but you can't use them in stand-alone apps.
    It is a product that is simultaneously a C++ application server and a Java application server, and has lots and lots of native code. It uses a specially modified JRE 1.3 for its own use.
    Sun dumped it (too buggy, too complex, too slow and very oddball) and used the J2EE SDK RI code instead to write the new versions of Sun ONE Application Server and Sun Java System Application Server.

  • TS1702 I have three apps that I tried to update and now they are stuck in waiting how do I fix this

    I have three apps that I tried to update and now they are frozen any ideas on how I can fix this

    You can try any or all of these suggestions that have worked for others in the past .... But ... YMMV.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.
    You can also try deleting the waiting icons - tap and hold down on an icon until it wiggles - the tap the X on the icon to delete it. Then try to download again.
    You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again.
    If all else fails, download the updates or the apps in iTunes on your computer and then sync the content to your iPad.

  • HT201263 I have an iPod Touch which I've had for almost 4 years, with 32 GB of memory. I am unable to update it, and consequently cannot install any newer apps. I am very disappointed that I spent a lot of $$; now Apple wants me to spend $$ again to get a

    I have an iPod Touch which I've had for almost 4 years, with 32 GB of memory. I am unable to update it, and consequently cannot install any newer apps. I am very disappointed that I spent a lot of $$; now Apple wants me to spend $$ again to get a new one. As I mentioned, I am pretty upset. Does anyone know if there's a work around?

    I suspect you have a 2G iPod. Those can only go to iOS 4.2.1.
    Identifying iPod models
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.

  • Hi! I have had the Creative Cloud in use before and now I want to start using the programs again. How do I do that?

    Hi! I have had the Creative Cloud in use before and now I want to start using the programs again. How do I do that?

    restart a subscription, https://creative.adobe.com/plans

  • I have set a strong password for my iPhone 5s, now I want to get rid of it and set a numeric 4 digit password. How to do that ??

    I have set a strong password for my iPhone 5s, now I want to get rid of it and set a numeric 4 digit password. How to do that ??

    go to settings>general>passcode lock and "enable simple passcode"

  • HT4623 I have Iphone5 with sim free brought on apr 2013 now i want to upgrade iphone5 to iphone5S. how to do that

    Dear,
    I have Iphone5 with sim free brought on apr 2013 now i want to upgrade iphone5 to iphone5S. how to do that.
    weather i can go for update or is possible pls clarify me.

    Venkata kiran wrote:
    My question if i have iphone 4S now i want to upgrade Iphone 5S in directly apple store wht is the process.
    Go to an Apple Store. Request the phone you want. Give them money or a credit card to pay for the phone.

  • I have 2 iphone with the same apple id. Now I want to use a different apple id for the iphones. How to do it? Help . Thank you!

    I have 2 iphone with the same apple id. Now I want to use a different apple id for the iphones. How to do it? Help . Thank you!

    Create a new Apple ID using a new valid e-mail address
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    In iPhone's Settings > Store > Apple ID > Sign Out and sign in the new.

  • I have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    i have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    You need to transfer your domain.sites file from your MacBook to your iMac.  This is the file where iWeb stores all info and can be found under User/Library/Application Support/iWeb/domain.sites.
    Transfer this file from your MacBook to the same place on your iMac and double click the domain.sites file and iWeb will open it on your iMac and you can update your site from there too.

  • I have ios 4.1.2 on my iphone 4, now i want to update to ios 6 not ios 7, plz help me

    i have ios 4.1.2 on my iphone 4, now i want to update to ios 6 not ios 7, plz help me

    Arxl wrote:
    ... my iphone 4, now i want to update to ios 6 not ios 7, ...
    No can do. The current iOS for an iPhone 4 is iOS 7.0.4

  • How do I add a print button that would print out pdf or different version than what is on the site?

    I see this example on NY Times.  If you pick any of their articles and click print or do the short cut (Command-P) ... (Control-P for windows), the layout of their article is completely customized and cleaner.  It seems like they've edited the print look to be different than what you see on the website.
    I find that very cool and something I've bent dying to achieve.  My guess is that I could make a pdf to what I want the print look to be and have a print button read that instead of the website but I don't know, I need help with this.

    I have but it's not what I'm looking for.  I want to edit what the printer will actually print when a reader clicks print.  So if the page has a puzzle, for example, and the reader clicks print.  The printer will print the puzzle in a different location on the page without some of the clutter that's on the site or have some message that's not originally present on the website.

Maybe you are looking for