Want help in JLabel

Hai
I am using JLabel with BoxLayout. The text is very large to fit in a single line, the Jframe size is 500x300.
I want the JLabel to align and wrap automatically in two or three lines automatically.
How can I do. I used <Html> for the string but the style is different from other components.
Can anyone throw some light on this.
With Thanks
Kumar

http://forum.java.sun.com/thread.jsp?forum=57&thread=399180 or search forum generally

Similar Messages

  • Sorry but i have a problem my IPAD has been stolen and i want help to know where is the place of it ? can i send the serial number or anything i want help to know the place of my IPAD and thanks  My name is :- Osama Rezk   I'm From :- Egypt

    Sorry but i have a problem my IPAD has been stolen and i want help to know where is the place of it ? can i send the serial number or anything i want help to know the place of my IPAD and thanks My name is :- Osama Rezk I'm From :- Egypt my icloud ID
    <Email Edited by Host>

    You will only be able to track your iPad if you have find my iPhone active and the iPad is connected to a network.
    Take a look at this link, http://support.apple.com/kb/PH2580

  • I want help, not a post in a forum I can never find again

    I want help, not a post in a forum i can never find

    http://helpx.adobe.com/indesign.html
    http://helpx.adobe.com/indesign/topics.html
    There's even a 20mb PDF here with all the Help Topics - http://helpx.adobe.com/pdf/indesign_reference.pdf

  • HT1918 plz i want help , how can i use credit card visa , im try to fill blank no. card information when i finish appear me msg ( the payment card you entered is not valid in israel p;ease provide avalid payment card for israel , im from palestine ) plz s

    plz i want help , how can i use credit card visa , im try to fill blank no. card information when i finish appear me msg ( the payment card you entered is not valid in israel p;ease provide avalid payment card for israel , im from palestine ) plz solutio?

    Oh thank god i am not the only one with this problem. It started with me on Saturday (aug 28) and still, no solution.
    I live in the border with the USA so i’ve been using my itunes account with a USA debit card and then it started with that **** declined CC problem =S
    The funny thing is that i’ve been trying to change countries, setting my account to Mexico and it would still say that the CC are declined. Tried 2 USA cards and 2 Mexican cards, no results =S
    Wanna read something funny. I even tried to create a brand new account based in Mexico, with another email address and it still wouldn’t let me, tells me my cards are not valid……..the **** apple!!! i cannot update any app and i just got my iphone 4 on friday last week and i am dying to try new apps.
    So far I’ve sent 2 emails and still no **** solution. At least i am not alone =’(

  • Want help in rdesktop software

    friends i want help in installing the rdesktop software plesae tel me the guid of installing rdesktop software . where i can find the rdesktop installation guid
    regards
    Asif

    I had a look around for some solaris binaries for rdesktop but the only link I could find was broken.
    The software was, however, very easy to compile. The instructions in the README file are pretty standard and should work for most Solaris installs.
    ./configure
    make
    make install
    This installs the software into /usr/local by default.
    These worked fine for me although you will of course have to make sure you install gcc and openssl (As these are both used by rdesktop). You can get these from www.sunfreeware.com. Install them, unpack the rdesktop distribution change into he rdesktop directory and run the 3 commands above.
    Sean

  • Want help in Vioce transfer on a socket

    Dear Buddies
    Want help in Vioce transfer on a socket
    Tell me how should I start it. I am new to Java World. but good in C/C++
    I knew much about sockects. I have to make application which transfere real time voice from both side.

    first you will have to digitize the stream, then cut it up into packets of handlable size, then you just sent them out over a valid socket connection.
    Yes, I know this is very simple, what part are you having toubles with?

  • My Macbook Air broke. Please help me, Russian Apple Customer Support don't want help me. I'm in despair.

    My Macbook Air broke. Please help me, Russian Apple Customer Support don't want help me. I'm in despair.
    Hi, I bought my MacBook Air  in your store. In the summer of 2012. My mac is included in the program MacBook Air Flash Storage Drive Replacement Program. I live in Russia. I called the Russian support Apple. They told me to bring mac to an authorized service center. An authorized service center I was told to wait 45 days of the new flash storage drive. It's very long for me. I can `t wait long. I work on a Mac. I do not have another computer. Russian support Аpple does not want to help me. Can you help me? Serial number my MacBook Air : c0*******rvc
    <Personal Information Edited by Host>

    Leaving you without a computer for 45 days isn't acceptable. Call Apple and ask for a loaner or replacement. Some people have been receiving them.
    If you still have no luck, then consider getting a USB 3.0 HDD and installing and running OS X on it until the replacement part is in.

  • Hello want help on rac

    hello ,
    i want help on
    Step-By-Step Installation of RAC on Windows NT/2000
    plz help me .
    Pankaj

    It would be interesting to go through with
    Step-By-Step Installation of RAC with RAW Datafiles on Windows 2000
    </b><br><br> hare krishna<br> Alok<br>

  • I've sent my i phone to technical service because of voice error. "Teleservice" is the authorized service in Turkey. Even my iphone is in the guarrente scope, service told me to change it with a new i phone by paying 654euro. I am aggrieved. I want help

    I've sent my i phone to technical service because of voice error. I can not talk without a headphone. sometimes screen is freezing. "Teleservice" is the authorizated service in Turkey. even my i phone is in the guarrante scope, service told me to change my iphone with the same i phone by paying 654 euro. I am aggrieved. I want help.
    I could not use my phone since i !ve bought it. Because it has always same problems. please help me.
    Thanks in advanced.
    Mine

    Did you buy it in Turkey (Turkcell or Vodafone)? If you did so, you have 2 years warranty from Gempa,KVK or another company for your iPhone. Also many technical services repair iPhones if you bought it from a foreign country though no luck from Gempa in this case. As I know there is no Genius Bar or AppleCare option for Turkey.

  • Help with JLabel

    Hello all. I am fairly new to Java and having a problem setting the text in a JLabel. I am trying to create a calculator program and when the user clicks a button I want that number to appear in a JLabel at the top. I used output.setText("7"); but when I compiled it said <identifier> expected. I will paste the full code below and would appreciate any help. Also, is there a getText function with JLabel, because I need to get what is currently in the output field and concatenate it with the number pressed.
    Thanks in advance for your help,
    Jeremy
    * Write a description of class calculator here.
    * @author (Jeremy Kruer)
    * @version (11/19/02)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class calculator extends JFrame
    private JButton one, two, three, four, five, six, seven, eight, nine, zero, dec, eq, plus, minus, mult, div;
    private JLabel output;
    private Container container;
    //set up GUI
    public calculator()
    //Create Title
    super("Calculator");
    //Set size and make visible
    setSize( 400, 400 );
    setVisible( true );
    container = getContentPane();
    container.setLayout( new FlowLayout() );
    //set up output
    output = new JLabel();
    container.add( output );
    //set up seven and register its event handler
    seven = new JButton( " 7 " );
    seven.addActionListener(
    //anonymouse inner class
    new ActionListener()
    //add a seven to the output diplay when clicked
    output.setText( "7" );
    }//end anonymouse inner class
    ); //end call to addActionListener
    container.add( seven );
    //set up eight
    eight = new JButton( " 8 " );
    container.add( eight );
    //set up nine
    nine = new JButton( " 9 " );
    container.add( nine );
    //set up div
    div = new JButton( " / " );
    container.add( div );
    //set up four
    four = new JButton( " 4 " );
    container.add( four );
    //set up five
    five = new JButton( " 5 " );
    container.add( five );
    //set up six
    six = new JButton( " 6 " );
    container.add( six );
    //set up mult
    mult = new JButton( " * " );
    container.add( mult );
    //set up one
    one = new JButton( " 1 " );
    container.add( one );
    //set up two
    two = new JButton( " 2 " );
    container.add( two );
    //set up three
    three = new JButton( " 3 " );
    container.add( three );
    //set up minus
    minus = new JButton( " - " );
    container.add( minus );
    //set up zero
    zero = new JButton( " 0 " );
    container.add( zero );
    //set up dec
    dec = new JButton( " . " );
    container.add( dec );
    //set up eq
    eq = new JButton( " = " );
    container.add( eq );
    //set up plus
    plus = new JButton( " +" );
    container.add( plus );
    //Set size and make visible
    setSize( 220, 250 );
    setVisible( true );
    //execute application
    public static void main( String args[] )
    calculator application = new calculator();
    application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    I played with the lauout a bit and added the actionListener:
    you will see what you click on !!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class calcu extends JFrame implements ActionListener
         private JButton  one, two, three, four, five, six, seven, eight, nine, zero, dec, eq, plus, minus, mult, div;
         private JLabel   output;
    public calcu()
         super("Calculator");
         JPanel container = new JPanel();
         container.setLayout(new FlowLayout(FlowLayout.LEFT));
         output = new JLabel("");
         output.setBorder(new MatteBorder(2,2,2,2,Color.gray));
         output.setPreferredSize(new Dimension(1,26));
         getContentPane().setBackground(Color.white);
         getContentPane().add("North",output);
         getContentPane().add("Center",container);
    //set up seven and register its event handler
         seven = new JButton(" 7 ");
         container.add(seven);
         seven.addActionListener(this);
    //set up eight
         eight = new JButton(" 8 ");
         container.add(eight);
         eight.addActionListener(this);
    //set up nine
         nine = new JButton( " 9 " );
         container.add( nine );
         nine.addActionListener(this);
    //set up div
         div = new JButton( " / " );
         container.add( div );
         div.addActionListener(this);
    //set up four
         four = new JButton( " 4 " );
         container.add( four );
         four.addActionListener(this);
    //set up five
         five = new JButton( " 5 " );
         container.add( five );
         five.addActionListener(this);
    //set up six
         six = new JButton( " 6 " );
         container.add( six );
         six.addActionListener(this);
    //set up mult
         mult = new JButton( " * " );
         container.add( mult );
         mult.addActionListener(this);
    //set up one
         one = new JButton( " 1 " );
         container.add( one );
         one.addActionListener(this);
    //set up two
         two = new JButton( " 2 " );
         container.add( two );
         two.addActionListener(this);
    //set up three
         three = new JButton( " 3 " );
         container.add( three );
         three.addActionListener(this);
    //set up minus
         minus = new JButton( " - " );
         container.add( minus );
         minus.addActionListener(this);
    //set up zero
         zero = new JButton( " 0 " );
         container.add( zero );
         zero.addActionListener(this);
    //set up dec
         dec = new JButton( " .  " );
         container.add( dec );
         dec.addActionListener(this);
    //set up eq
         eq = new JButton( " = " );
         container.add( eq );
         eq.addActionListener(this);
    //set up plus
         plus = new JButton( " +" );
         container.add( plus );
         plus.addActionListener(this);
    //Set size and make visible
         setSize(220,250);
         setResizable(false);
         setVisible( true );
    public void actionPerformed(ActionEvent ae)
         JButton but = (JButton)ae.getSource();
         output.setText(but.getText());
    //execute application
    public static void main( String args[] )
         calcu application = new calcu();
         application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    } Noah

  • Want help with "Could not set up your CS Live account. Try again later."

    Hi Folks
    I've got an NFR of CS6 and I'm trying to give Adobe Story a shot.
    Seems it requires online content and a CS Live account to do anything.
    But when I try to create one it dies with the error message:
    Account setup not completed
    Could not set up your CS Live account. Try again later.
    Can you help?
       Joe
    UPDATE: Downloaded update and that fixed things.
    However, turns out my NFR of CS6 Production Premium doesn't allow me to use Story.
    And here all I wanted to to do try out the transcription features of Premiere Pro.
    Without a script it's complete gobbledygook. Would like to try it with a script but it appears I need Story to convert my PDF to Adobe Story format.
    Oh well.

    I ran into the same problem you did, Joe.  I just realized Story is all online now.  Story.Adobe.com

  • Want help to execute the programm of MethodEntryEvent

    Hi,
    I am trying to develop a programm for automatic logging in the programme. I took the hepl of java API and the Google site for searching some programms and successed also. but while running these sample programms i am getting classNotFound exception and some other exceptions also. i executed the programm Seq.java downloaded from the site http://search.cpan.org/src/PHILCROW/UML-Sequence-0.05/java/Seq.java. i am not able to understand how to execute it. what ever i tried its giving the same output whatever defined in the System.err() in the file. but it should display the corrosponding class details for which i need to see the output.
    can anyone help me in this regard and tell me the process to execute the programm.
    i took another e.g. trace example, which (in J2SE 1.4.x or 5.x) will be found in $JAVA_HOME/demo/jpda/examples.jar and unpacking it by
    jar -xvf $JAVA_HOME/demo/jpda/examples.jar i found the
    com/sun/tools/example/trace/Trace.java
    when i tried to execute it to see the output for some other programm i got the following exceptions,
    -- VM Started --
    ====== main ======
    main -- DateExample
    | Exception: instance of java.lang.ClassNotFoundException(id=97) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=98) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=98) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=99) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=99) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=100) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=100) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=101) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=101) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=102) catch: java.util.ResourceBundle:1074
    | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=102) catch: java.util.ResourceBundle:1074
    | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=105) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=105) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=106) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=106) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=115) catch: null
    | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=118) catch: null
    ====== main end ======
    -- The application exited --
    i execute this programm i used the command as
    java Trace -output trace.log DateExample
    where trace.log is output file and DateExample is the java file.
    Can any one help me in this regard to execute the programms and can give me a detailed solution procedure.
    can anyone suggest me any other programm for auto exit and entry display for classes or methods with detailed execution steps.
    Thanks,

    Hi,
    i tried by setting the class path in the environment variables.
    still i am getting the same exceptions. i m sending the files on which i m working and requesting to give some solution. the files are
    // Trace.java
    import com.sun.jdi.VirtualMachine;
    import com.sun.jdi.Bootstrap;
    import com.sun.jdi.connect.*;
    import java.util.Map;
    import java.util.List;
    import java.util.Iterator;
    import java.io.PrintWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    * This program traces the execution of another program.
    * See "java Trace -help".
    * It is a simple example of the use of the Java Debug Interface.
    * @version @(#) Trace.java 1.4 03/01/23 17:55:38
    * @author Robert Field
    public class Trace {
    // Running remote VM
    private final VirtualMachine vm;
    // Thread transferring remote error stream to our error stream
    private Thread errThread = null;
    // Thread transferring remote output stream to our output stream
    private Thread outThread = null;
    // Mode for tracing the Trace program (default= 0 off)
    private int debugTraceMode = 0;
    // Do we want to watch assignments to fields
    private boolean watchFields = false;
    // Class patterns for which we don't want events
    private String[] excludes = {"java.*", "javax.*", "sun.*",
    "com.sun.*"};
    * main
    public static void main(String[] args) {
    //new Trace(args);
    //DateExample d = new DateExample();
    //String[] arg = {(new DateExample().toString())};
    //String[] arg = {"E:/java_progs/classLoader/project logging/com/sun/tools/example/trace/DateExample.java"};
    //d.dateDisplay();
    new Trace(args);
    * Parse the command line arguments.
    * Launch target VM.
    * Generate the trace.
    Trace(String[] args) {
    System.out.println("entered into the method Trace(String[] args)");
    PrintWriter writer = new PrintWriter(System.out);
    System.out.println("Printer object created.....");
    int inx;
    for (inx = 0; inx < args.length; ++inx) {
    System.out.println("inside for loop args.length is "+args.length+" and the data is "+args[inx]);
    String arg = args[inx];
    if (arg.charAt(0) != '-') {
    break;
    if (arg.equals("-output")) {
    System.out.println("inside args== -output");
    try {
    writer = new PrintWriter(new FileWriter(args[++inx]));
    System.out.println("writer object createed....");
    } catch (IOException exc) {
    System.err.println("Cannot open output file: " + args[inx]
    + " - " + exc);
    System.exit(1);
    } else if (arg.equals("-all")) {
    System.out.println("inside args== -all");
    excludes = new String[0];
    } else if (arg.equals("-fields")) {
    System.out.println("inside args== -fields");
    watchFields = true;
    } else if (arg.equals("-dbgtrace")) {
    System.out.println("inside args== -bdgtrace");
    debugTraceMode = Integer.parseInt(args[++inx]);
    System.out.println("inside args== -bdgtrace the debugTraceMode is "+debugTraceMode);
    } else if (arg.equals("-help")) {
    System.out.println("inside args== -help called usage();");
    usage();
    System.exit(0);
    } else {
    System.err.println("No option: " + arg);
    usage();
    System.exit(1);
    System.out.println("the index is "+inx+" the args.length is "+args.length);
    if (inx >= args.length) {
    System.err.println("<class> missing");
    usage();
    System.exit(1);
    StringBuffer sb = new StringBuffer();
    sb.append(args[inx]);
    for (++inx; inx < args.length; ++inx) {
    sb.append(' ');
    sb.append(args[inx]);
    System.out.println("the string buffer contains \n "+sb);
    vm = launchTarget(sb.toString());
    generateTrace(writer);
    System.out.println("after generateTrace(writer)");
    * Generate the trace.
    * Enable events, start thread to display events,
    * start threads to forward remote error and output streams,
    * resume the remote VM, wait for the final event, and shutdown.
    void generateTrace(PrintWriter writer) {
    System.out.println("inside generateTrace(PrintWriter writer) the debugTraceMode is "+debugTraceMode);
    vm.setDebugTraceMode(debugTraceMode);
    EventThread eventThread = new EventThread(vm, excludes, writer);
    eventThread.setEventRequests(watchFields);
    System.out.println("inside generateTrace(PrintWriter writer) the eventThread.setEventRequests(watchFields) is ");
    eventThread.start();
    redirectOutput();
    vm.resume();
    // Shutdown begins when event thread terminates
    try {
    eventThread.join();
    errThread.join(); // Make sure output is forwarded
    outThread.join(); // before we exit
    } catch (InterruptedException exc) {
    // we don't interrupt
    writer.close();
    System.out.println("the writer is closed....");
    * Launch target VM.
    * Forward target's output and error.
    VirtualMachine launchTarget(String mainArgs) {
    System.out.println("inside VirtualMachine launchTarget(String mainArgs) "+mainArgs);
    LaunchingConnector connector = findLaunchingConnector();
    System.out.println("Lunching connector found "+connector);
    Map arguments = connectorArguments(connector, mainArgs);
    try {
    return connector.launch(arguments);
    } catch (IOException exc) {
    throw new Error("Unable to launch target VM: " + exc);
    } catch (IllegalConnectorArgumentsException exc) {
    throw new Error("Internal error: " + exc);
    } catch (VMStartException exc) {
    throw new Error("Target VM failed to initialize: " +
    exc.getMessage());
    void redirectOutput() {
    Process process = vm.process();
    System.out.println("inside redirectOutput() after getting the virtual m/c process");
    // Copy target's output and error to our output and error.
    errThread = new StreamRedirectThread("error reader",
    process.getErrorStream(),
    System.err);
    outThread = new StreamRedirectThread("output reader",
    process.getInputStream(),
    System.out);
    errThread.start();
    outThread.start();
    * Find a com.sun.jdi.CommandLineLaunch connector
    LaunchingConnector findLaunchingConnector() {
    List connectors = Bootstrap.virtualMachineManager().allConnectors();
    System.out.println("inside redirectOutput() after getting the connectors list");
    Iterator iter = connectors.iterator();
    while (iter.hasNext()) {
    Connector connector = (Connector)iter.next();
    System.out.println("inside while (iter.hasNext()) after getting the connector objects from itterator");
    if (connector.name().equals("com.sun.jdi.CommandLineLaunch")) {
    System.out.println("inside if (connector.name().equals('com.sun.jdi.CommandLineLaunch'))");
    return (LaunchingConnector)connector;
    throw new Error("No launching connector");
    * Return the launching connector's arguments.
    Map connectorArguments(LaunchingConnector connector, String mainArgs) {
    System.out.println("Map connectorArguments(LaunchingConnector connector, String mainArgs) the mainArgs is "+mainArgs);
    Map arguments = connector.defaultArguments();
    Connector.Argument mainArg =
    (Connector.Argument)arguments.get("main");
    if (mainArg == null) {
    System.out.println("inside the mainArg==null ");
    throw new Error("Bad launching connector");
    mainArg.setValue(mainArgs);
    System.out.println("the mainArg is "+mainArg);
    if (watchFields) {
    System.out.println("inside the if (watchFields)********");
    // We need a VM that supports watchpoints
    Connector.Argument optionArg =
    (Connector.Argument)arguments.get("options");
    if (optionArg == null) {
    throw new Error("Bad launching connector");
    System.out.println("inside the if (watchFields)the optionArg is "+optionArg);
    optionArg.setValue("-classic");
    System.out.println("optionArg.getValue() is ");
    return arguments;
    * Print command line usage help
    void usage() {
    System.out.println("inside usage()");
    System.err.println("Usage: java Trace <options> <class> <args>");
    System.err.println("<options> are:");
    System.err.println(
    " -output <filename> Output trace to <filename>");
    System.err.println(
    " -all Include system classes in output");
    System.err.println(
    " -help Print this help message");
    System.err.println("<class> is the program to trace");
    System.err.println("<args> are the arguments to <class>");
    // DateExample.java
    import java.util.Date;
    import java.text.DateFormat;
    import java.util.Calendar;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class DateExample {
    public static void main(String[] args) {
    Date a = new Date();
    System.out.println("Today is : "+a);
    Calendar ca= Calendar.getInstance();
    ca.set(a.getYear(),a.getMonth(),a.getDate());
    ca.add(Calendar.DATE,1);
    DateFormat df1 = DateFormat.getDateInstance(DateFormat.SHORT);
    String s1 = df1.format(ca.getTime());
    System.out.println("(SHORT) Today is + 1 :" + s1);
    //java.sql.Date s = new java.sql.Date(2005,6,1);
    //System.out.println("Date from sql is : "+s);
    Date a1 = new Date(2005,06,01);
    System.out.println("Today is a1 : "+a1);
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
    System.out.println("After format :"+formatter.format(a1));
    System.out.println("After format :"+formatter.format(new Date(s1)));
    java.text.SimpleDateFormat formatter1 = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
    System.out.println("After format :"+formatter1.format(a1));
    // EventThread.java
    import com.sun.jdi.*;
    import com.sun.jdi.request.*;
    import com.sun.jdi.event.*;
    import java.util.*;
    import java.io.PrintWriter;
    * This class processes incoming JDI events and displays them
    * @version @(#) EventThread.java 1.4 03/01/23 17:55:38
    * @author Robert Field
    public class EventThread extends Thread {
    private final VirtualMachine vm; // Running VM
    private final String[] excludes; // Packages to exclude
    private final PrintWriter writer; // Where output goes
    static String nextBaseIndent = ""; // Starting indent for next thread
    private boolean connected = true; // Connected to VM
    private boolean vmDied = true; // VMDeath occurred
    // Maps ThreadReference to ThreadTrace instances
    private Map traceMap = new HashMap();
    EventThread(VirtualMachine vm, String[] excludes, PrintWriter writer) {
    super("event-handler");
    this.vm = vm;
    this.excludes = excludes;
    this.writer = writer;
    System.out.println("inside EventThread(VirtualMachine vm, String[] excludes, PrintWriter writer) ");
    * Run the event handling thread.
    * As long as we are connected, get event sets off
    * the queue and dispatch the events within them.
    public void run() {
    System.out.println("inside run() ");
    EventQueue queue = vm.eventQueue();
    while (connected) {
    System.out.println("inside while (connected) ");
    try {
    EventSet eventSet = queue.remove();
    EventIterator it = eventSet.eventIterator();
    System.out.println("got EventSet and EventIterator *** ");
    while (it.hasNext()) {
    System.out.println("inside while (it.hasNext())");
    handleEvent(it.nextEvent());
    eventSet.resume();
    System.out.println("event is resumed ***** ");
    } catch (InterruptedException exc) {
    // Ignore
    } catch (VMDisconnectedException discExc) {
    handleDisconnectedException();
    break;
    * Create the desired event requests, and enable
    * them so that we will get events.
    * @param excludes Class patterns for which we don't want events
    * @param watchFields Do we want to watch assignments to fields
    void setEventRequests(boolean watchFields) {
    System.out.println("inside setEventRequests(boolean watchFields) ");
    EventRequestManager mgr = vm.eventRequestManager();
    // want all exceptions
    ExceptionRequest excReq = mgr.createExceptionRequest(null,
    true, true);
    // suspend so we can step
    excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    excReq.enable();
    MethodEntryRequest menr = mgr.createMethodEntryRequest();
    for (int i=0; i<excludes.length; ++i) {
    System.out.println("inside for (int i=0; i><excludes.length; ++i) for createMethodEntryRequest() ");
    menr.addClassExclusionFilter(excludes);
    menr.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    menr.enable();
    MethodExitRequest mexr = mgr.createMethodExitRequest();
    for (int i=0; i><excludes.length; ++i) {
    System.out.println("inside for (int i=0; i><excludes.length; ++i) for createMethodExitRequest() ");
    mexr.addClassExclusionFilter(excludes);
    mexr.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    mexr.enable();
    ThreadDeathRequest tdr = mgr.createThreadDeathRequest();
    // Make sure we sync on thread death
    tdr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    tdr.enable();
    if (watchFields) {
    System.out.println("inside if (watchFields) ************** ");
    ClassPrepareRequest cpr = mgr.createClassPrepareRequest();
    for (int i=0; i><excludes.length; ++i) {
    System.out.println("inside for (int i=0; i><excludes.length; ++i) the excludes.length is ************** "+excludes.length);
    cpr.addClassExclusionFilter(excludes);
    cpr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    cpr.enable();
    * This class keeps context on events in one thread.
    * In this implementation, context is the indentation prefix.
    class ThreadTrace {
    final ThreadReference thread;
    final String baseIndent;
    static final String threadDelta = " ";
    StringBuffer indent;
    ThreadTrace(ThreadReference thread) {
    System.out.println("inside ThreadTrace(ThreadReference thread)");
    this.thread = thread;
    this.baseIndent = nextBaseIndent;
    indent = new StringBuffer(baseIndent);
    nextBaseIndent += threadDelta;
    println("====== " + thread.name() + " ======");
    private void println(String str) {
    System.out.println("inside void println(String str)");
    writer.print(indent);
    writer.println(str);
    void methodEntryEvent(MethodEntryEvent event) {
    System.out.println("inside methodEntryEvent(MethodEntryEvent event)");
    println(event.method().name() + " -- "
    + event.method().declaringType().name());
    indent.append("| ");
    void methodExitEvent(MethodExitEvent event) {
    System.out.println("inside methodExitEvent(MethodExitEvent event)");
    indent.setLength(indent.length()-2);
    void fieldWatchEvent(ModificationWatchpointEvent event) {
    System.out.println("inside fieldWatchEvent(ModificationWatchpointEvent event)");
    Field field = event.field();
    Value value = event.valueToBe();
    println(" " + field.name() + " = " + value);
    void exceptionEvent(ExceptionEvent event) {
    System.out.println("inside exceptionEvent(ExceptionEvent event) ");
    println("Exception: " + event.exception() +
    " catch: " + event.catchLocation());
    // Step to the catch
    EventRequestManager mgr = vm.eventRequestManager();
    StepRequest req = mgr.createStepRequest(thread,
    StepRequest.STEP_MIN,
    StepRequest.STEP_INTO);
    System.out.println("stepRequest is created "+req);
    req.addCountFilter(1); // next step only
    req.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    req.enable();
    // Step to exception catch
    void stepEvent(StepEvent event) {
    System.out.println("inside stepEvent(StepEvent event) ");
    // Adjust call depth
    int cnt = 0;
    indent = new StringBuffer(baseIndent);
    try {
    cnt = thread.frameCount();
    System.out.println("inside try cnt is "+cnt);
    } catch (IncompatibleThreadStateException exc) {
    while (cnt-- > 0) {
    System.out.println("inside while indent is "+indent);
    indent.append("| ");
    EventRequestManager mgr = vm.eventRequestManager();
    mgr.deleteEventRequest(event.request());
    void threadDeathEvent(ThreadDeathEvent event) {
    System.out.println("inside threadDeathEvent(ThreadDeathEvent event) ");
    indent = new StringBuffer(baseIndent);
    println("====== " + thread.name() + " end ======");
    * Returns the ThreadTrace instance for the specified thread,
    * creating one if needed.
    ThreadTrace threadTrace(ThreadReference thread) {
    ThreadTrace trace = (ThreadTrace)traceMap.get(thread);
    System.out.println("inside ThreadTrace threadTrace(ThreadReference thread) trace is "+trace);
    if (trace == null) {
    trace = new ThreadTrace(thread);
    traceMap.put(thread, trace);
    return trace;
    * Dispatch incoming events
    private void handleEvent(Event event) {
    System.out.println("inside handleEvent(Event event) ");
    if (event instanceof ExceptionEvent) {
    System.out.println("inside handleEvent(Event event) in ExceptionEvent ");
    exceptionEvent((ExceptionEvent)event);
    } else if (event instanceof ModificationWatchpointEvent) {
    System.out.println("inside handleEvent(Event event) in ModificationWatchpointEvent ");
    fieldWatchEvent((ModificationWatchpointEvent)event);
    } else if (event instanceof MethodEntryEvent) {
    System.out.println("inside handleEvent(Event event) in MethodEntryEvent ");
    methodEntryEvent((MethodEntryEvent)event);
    } else if (event instanceof MethodExitEvent) {
    System.out.println("inside handleEvent(Event event) in MethodExitEvent ");
    methodExitEvent((MethodExitEvent)event);
    } else if (event instanceof StepEvent) {
    System.out.println("inside handleEvent(Event event) in StepEvent ");
    stepEvent((StepEvent)event);
    } else if (event instanceof ThreadDeathEvent) {
    System.out.println("inside handleEvent(Event event) in ThreadDeathEvent ");
    threadDeathEvent((ThreadDeathEvent)event);
    } else if (event instanceof ClassPrepareEvent) {
    System.out.println("inside handleEvent(Event event) in ClassPrepareEvent ");
    classPrepareEvent((ClassPrepareEvent)event);
    } else if (event instanceof VMStartEvent) {
    System.out.println("inside handleEvent(Event event) in VMStartEvent ");
    vmStartEvent((VMStartEvent)event);
    } else if (event instanceof VMDeathEvent) {
    System.out.println("inside handleEvent(Event event) in VMDeathEvent ");
    vmDeathEvent((VMDeathEvent)event);
    } else if (event instanceof VMDisconnectEvent) {
    System.out.println("inside handleEvent(Event event) in VMDisconnectEvent ");
    vmDisconnectEvent((VMDisconnectEvent)event);
    } else {
    System.out.println("inside handleEvent(Event event) in else unexcepted type ");
    throw new Error("Unexpected event type");
    * A VMDisconnectedException has happened while dealing with
    * another event. We need to flush the event queue, dealing only
    * with exit events (VMDeath, VMDisconnect) so that we terminate
    * correctly.
    synchronized void handleDisconnectedException() {
    System.out.println("inside handleDisconnectedException() ");
    EventQueue queue = vm.eventQueue();
    while (connected) {
    System.out.println("inside handleDisconnectedException() in while (connected) ");
    try {
    EventSet eventSet = queue.remove();
    EventIterator iter = eventSet.eventIterator();
    System.out.println("inside handleDisconnectedException() got EventSet & EventIterator ");
    while (iter.hasNext()) {
    System.out.println("inside handleDisconnectedException() in while (iter.hasNext()) ");
    Event event = iter.nextEvent();
    if (event instanceof VMDeathEvent) {
    System.out.println("inside handleDisconnectedException() in if ");
    vmDeathEvent((VMDeathEvent)event);
    } else if (event instanceof VMDisconnectEvent) {
    System.out.println("inside handleDisconnectedException() in else ");
    vmDisconnectEvent((VMDisconnectEvent)event);
    eventSet.resume(); // Resume the VM
    } catch (InterruptedException exc) {
    // ignore
    private void vmStartEvent(VMStartEvent event) {
    System.out.println("inside vmStartEvent(VMStartEvent event)**** ");
    writer.println("-- VM Started --");
    // Forward event for thread specific processing
    private void methodEntryEvent(MethodEntryEvent event) {
    System.out.println("inside methodEntryEvent(MethodEntryEvent event)****** ");
    threadTrace(event.thread()).methodEntryEvent(event);
    // Forward event for thread specific processing
    private void methodExitEvent(MethodExitEvent event) {
    System.out.println("inside methodExitEvent(MethodExitEvent event)****** ");
    threadTrace(event.thread()).methodExitEvent(event);
    // Forward event for thread specific processing
    private void stepEvent(StepEvent event) {
    System.out.println("inside stepEvent(StepEvent event)****** ");
    threadTrace(event.thread()).stepEvent(event);
    // Forward event for thread specific processing
    private void fieldWatchEvent(ModificationWatchpointEvent event) {
    System.out.println("inside fieldWatchEvent(ModificationWatchpointEvent event)***** ");
    threadTrace(event.thread()).fieldWatchEvent(event);
    void threadDeathEvent(ThreadDeathEvent event) {
    System.out.println("inside threadDeathEvent(ThreadDeathEvent event)****** ");
    ThreadTrace trace = (ThreadTrace)traceMap.get(event.thread());
    if (trace != null) { // only want threads we care about
    trace.threadDeathEvent(event); // Forward event
    * A new class has been loaded.
    * Set watchpoints on each of its fields
    private void classPrepareEvent(ClassPrepareEvent event) {
    System.out.println("inside classPrepareEvent(ClassPrepareEvent event)****** ");
    EventRequestManager mgr = vm.eventRequestManager();
    List fields = event.referenceType().visibleFields();
    for (Iterator it = fields.iterator(); it.hasNext(); ) {
    System.out.println("inside classPrepareEvent(ClassPrepareEvent event) inside for loop Iterator ****** ");
    Field field = (Field)it.next();
    ModificationWatchpointRequest req =
    mgr.createModificationWatchpointRequest(field);
    for (int i=0; i<excludes.length; ++i) {
    System.out.println("inside classPrepareEvent(ClassPrepareEvent event) inside for loop int ****** ");
    req.addClassExclusionFilter(excludes);
    req.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    req.enable();
    private void exceptionEvent(ExceptionEvent event) {
    System.out.println("inside exceptionEvent(ExceptionEvent event)****** ");
    ThreadTrace trace = (ThreadTrace)traceMap.get(event.thread());
    if (trace != null) { // only want threads we care about
    trace.exceptionEvent(event); // Forward event
    public void vmDeathEvent(VMDeathEvent event) {
    System.out.println("inside vmDeathEvent(VMDeathEvent event)****** ");
    vmDied = true;
    writer.println("-- The application exited --");
    public void vmDisconnectEvent(VMDisconnectEvent event) {
    System.out.println("inside vmDisconnectEvent(VMDisconnectEvent event)****** ");
    connected = false;
    if (!vmDied) {
    System.out.println("inside vmDisconnectEvent(VMDisconnectEvent event)in if loop ****** ");
    writer.println("-- The application has been disconnected --");
    // StreamRedirectThread.java
    import java.io.*;
    * StreamRedirectThread is a thread which copies it's input to
    * it's output and terminates when it completes.
    * @version @(#) StreamRedirectThread.java 1.4 03/01/23 17:55:38
    * @author Robert Field
    class StreamRedirectThread extends Thread {
    private final Reader in;
    private final Writer out;
    private static final int BUFFER_SIZE = 2048;
    * Set up for copy.
    * @param name Name of the thread
    * @param in Stream to copy from
    * @param out Stream to copy to
    StreamRedirectThread(String name, InputStream in, OutputStream out) {
    super(name);
    this.in = new InputStreamReader(in);
    this.out = new OutputStreamWriter(out);
    setPriority(Thread.MAX_PRIORITY-1);
    System.out.println("inside StreamRedirectThread(String name, InputStream in, OutputStream out) ****** ");
    * Copy.
    public void run() {
    System.out.println("inside StreamRedirectThread class in run() ****** ");
    try {
    char[] cbuf = new char[BUFFER_SIZE];
    int count;
    while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
    System.out.println("inside run() in while loop the count is ****** "+count);
    out.write(cbuf, 0, count);
    out.flush();
    } catch(IOException exc) {
    System.err.println("Child I/O Transfer - " + exc);
    by using these files i m trying to trace the execution of DateExample.java through the Trace.java by using the command
    java Trace -output trace.log DateExample
    by executiing i m getting the exceptions in the output file trace.log
    -- VM Started --
    ====== main ======
    main -- DateExample
    | Exception: instance of java.lang.ClassNotFoundException(id=97) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=99) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=99) catch: java.lang.ClassLoader:286
    | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=100) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=100) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=101) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=101) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=102) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=102) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.util.zip.ZipException(id=104) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.util.zip.ZipException(id=104) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=105) catch: java.util.ResourceBundle:1074
    | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.lang.ClassNotFoundException(id=105) catch: java.util.ResourceBundle:1074
    | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=108) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=108) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=109) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=109) catch: sun.misc.URLClassPath:293
    | | | | | | | | | | | | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=118) catch: null
    | | | | | | | | | | | | | | Exception: instance of java.io.FileNotFoundException(id=121) catch: null
    ====== main end ======
    -- The application exited --
    Could any one help me in this regard to execute the programm.
    Could any one help to show the execution of the Seq.java downloaded from the site http://search.cpan.org/src/PHILCROW/UML-Sequence-0.05/java/Seq.java, what i mentioned in my previous mail.
    thanks,

  • I want help in MM Report?

    Hi,
    Hi I m new in ABAP Programming. Can anyone help me in this.
    I have to generate report which shows  "the inventory of all the materials of a certain material type at certain locations and the status of such inventory. "
    What I want to know is :-
    1.What will be the flow of this report? (For eg. which tables I have to declare, then at selection screen which field should be there so and so.)
    2.Which tables and fields can be used in this report of MM?
    Thanks and Regards,
    Gagan

    http://sapwiki.iwoars.net/index.php/Tabellen
    In german, I'm sorry.
    Kind regards
    Matthias

  • Want help in developing my first game in java!!

    I want to develop a tetris game in java..can any one help me on this..basically i m new to java programming, i want to know abt the graphical part ..how to make that.. i will code the rest..I want to make an application rather than an applet..

    look at the Java2D demo that comes with the JDK
    it has lots of source code and just about everything you'll need to do in Tetris (technology wise) is in there, except the game logic.
    when you're ready to move into 3D and heavier apps, try this book:
    Practical Java Game Programming
    http://www.amazon.com/exec/obidos/tg/detail/-/1584503262/102-3570681-1096110?v=glance

  • Want help on AJAX

    hi,
    I know abt AJAX theriatically. i want to work on it.would any one help me by sending the required jar files and simple example.I browsed for those in https://bpcatalog.dev.java.net but i can't get all. Plese send me those.

    Why not try the open-source Ajax framework ZK ( http://zk1.sourceforge.net )?
    You can try the online LIVE DEMO here: ( http://www.potix.com/zkdemo/userguide )

Maybe you are looking for

  • HT4009 Problem with in apps purchase. Pls help

    Since about a week now I can no longer purchase gems in fashion story or my bakery.     I do not have a restriction set up in my iPad.     Previous billing went through okay I think.  I get message. Contact iTunes support to complete this transaction

  • I have a problem with my Macbook Pro which is as follows:

    Firstly, its a  250 Gb Hard Drive Mac Book Pro. When I open finder it appears as Michael-Jack Pollards and if I click get info it tells me it's a 499 gb Hard Drive with 91 gb of free space. So, when I use Carbon Copy Cloner I get two options to Clone

  • Windows Setup Error, Need Help

    so i just tried to install what i think was XP home edition on my MacBook. I picked the partitioned boot camp disk to install it to, and all went well until the setup was complete. After setup was finished copying files, my computer rebooted and came

  • Like Firefox, can Safari restore its tabs when (closed and) re-opened?

    If Firefox contains open / active tabs and is closed, those tabs (and their history) can (via a setting) be restored when Firefox is re-opened. Can Safari restore its tabs when it's re-opened as well?

  • DISM /capture-image: Not enough space on disk

    Slow and sure WE8S drives me crazy. I just tried to capture as WE8S image using DISM which aborted somewhere at 20%. The logfile tells "There is not enogh space on disk", a few log messages later I see that this belongs to X:\ (the WinPE "RAM disk").