Closing Frames

High can someone help me with my two queries?
The first is how can i get a function to run when a frame is closed, i.e. the main frame.
The second if i have 2 frames open, how can i close only one of them with out exiting the program.
Thanx alot

how can i get a function to run when a frame is closed, i.e. the main frame.
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter(){
  public void windowClosing(WindowEvent we){
    //call function here;
    System.exit(0);
The second if i have 2 frames open, how can i close only one of them with out exiting the program.
frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);should be the default, but including it makes your intent clear

Similar Messages

  • Help closing frames and disabling frames

    hey, i'm making this type of quiz game and i've got the primary game frame with it's game panel. When the player matches two images on this main panel, another frame with a panel is drawn on top of the main game and asks the user a question, if the user gets the right answer i want it to return back to the game and close the quiz frame. I can't use system.exit(0) when the user gets the correct answer because the whole application shuts down. how do i just close this one? Also, i make a new quiz frame object for each match on the game board, the constructor of the quiz frame takes an int as a parameter which represents the game state and thus which question to ask the user.
    So that's just a bit of background information, the two questions i have are:
    1. How do i close the quiz frame when the user enters the correct answer without closing the entire game application? As it is my Panel within my quiz frame doing the check to see if the users input is correct, i'd like to be able to close the quiz frame down from this panel. so i'm looking for
    something like:
    this is just some pseudo code to explain what i want to do
    if(answerCorrect) {
    this.parentFrame.close(); 
    }2. How do disable the primary game while the quiz frame is up and displaying a question to the player? I don't want the player to be able to continue playing the game without first entering the correct answer. and only when they answer correct do I wish the main game to become re-enabled.
    If the answers are not simple then i'd be happy to read any links/information which would help.
    Thanks a heap i really appreciate it :)

    Encephalopathic wrote:
    but a better and more flexible way to implement this is to allow outside objects pass this array into the QuizPanel object, either by its constructor or by a setter method allowing you to use the same QuizPanel class for different data.Ages ago I downloaded an example from these forums which does just that, and it also randomizes the order or the answers. See below -
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;
    import javax.swing.BorderFactory;
    import javax.swing.ButtonGroup;
    import javax.swing.ButtonModel;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    import javax.swing.SwingConstants;
    public class QuizGUI
      private JPanel mainPanel = new JPanel();
      private Question[] questions =
        new Question("How many months in a year?", "12", new String[]
          "1", "Several", "100", "Heck if I know?"
        new Question("Who was buried in Grant's Tomb?", "Grant", new String[]
          "Washington", "Jefferson", "Lincoln", "Mickey Mouse"
        new Question("What's the air-speed velocity of a fully ladden swallow",
            "African or European?", new String[]
              "100 mi/hr", "25 mi/hr", "50 mi/hr", "-10 mi/hr"
        new Question("What color was Washington's white horse?", "White",
            new String[]
              "Blue", "Brown", "Chartreuse", "Mauve"
      private QuestionGUI[] questionGuis = new QuestionGUI[questions.length];
      public QuizGUI()
        JPanel questionPanel = new JPanel(new GridLayout(0, 1, 0, 10));
        for (int i = 0; i < questionGuis.length; i++)
          questionGuis[i] = new QuestionGUI(questions);
    JComponent comp = questionGuis[i].getComponent();
    comp.setBorder(BorderFactory.createEtchedBorder());
    questionPanel.add(comp);
    JButton checkAnswersBtn = new JButton("CheckAnswers");
    checkAnswersBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    int score = 0;
    for (QuestionGUI quest : questionGuis)
    if (quest.isSelectionCorrect())
    score++;
    else
    System.out.println("For the question: \"" + quest.getQuestion().getQuestion() + "\",");
    System.out.println("\"" + quest.getSelectedString() + "\" is the wrong answer");
    System.out.println("The correct answer is: \"" + quest.getQuestion().getCorrectAnswer() + "\"");
    System.out.println("Score: " + score);
    JPanel btnPanel = new JPanel();
    btnPanel.add(checkAnswersBtn);
    int ebGap = 10;
    mainPanel.setBorder(BorderFactory.createEmptyBorder(ebGap, ebGap, ebGap, ebGap));
    mainPanel.setLayout(new BorderLayout());
    mainPanel.add(questionPanel, BorderLayout.CENTER);
    mainPanel.add(btnPanel, BorderLayout.SOUTH);
    public JComponent getComponent()
    return mainPanel;
    private static void createAndShowUI()
    JFrame frame = new JFrame("Quiz");
    frame.getContentPane().add(new QuizGUI().getComponent());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
    public void run()
    createAndShowUI();
    class QuestionGUI
    private JPanel mainPanel = new JPanel();
    private Question question;
    private ButtonGroup buttonGrp = new ButtonGroup();
    public QuestionGUI(Question question)
    this.question = question;
    JPanel radioPanel = new JPanel(new GridLayout(1, 0, 10, 0));
    for (String str : question.getAnswers())
    JRadioButton rButton = new JRadioButton(str);
    rButton.setActionCommand(str);
    radioPanel.add(rButton);
    buttonGrp.add(rButton);
    mainPanel.setLayout(new BorderLayout(10, 10));
    mainPanel.add(new JLabel(question.getQuestion(), SwingConstants.LEFT),
    BorderLayout.NORTH);
    mainPanel.add(radioPanel, BorderLayout.CENTER);
    public Question getQuestion()
    return question;
    public String getSelectedString()
    ButtonModel model = buttonGrp.getSelection();
    if (model != null)
    return model.getActionCommand();
    else
    return null;
    public boolean isSelectionCorrect()
    ButtonModel model = buttonGrp.getSelection();
    if (model != null)
    return question.isCorrect(model.getActionCommand());
    return false;
    public JComponent getComponent()
    return mainPanel;
    class Question
    private String question;
    private String answer;
    private List<String> answers = new ArrayList<String>();
    public Question(String q, String answer, String[] badAnswers)
    question = q;
    this.answer = answer;
    for (String string : badAnswers)
    answers.add(string);
    answers.add(answer);
    Collections.shuffle(answers);
    public String getQuestion()
    return question;
    public String[] getAnswers()
    return answers.toArray(new String[0]);
    public String getCorrectAnswer()
    return answer;
    public boolean isCorrect(String selection)
    return answer.equals(selection);

  • Execute Code on closing frame

    Dear friends,
    I would like to know how to execute code on closing the frame.

              JFrame frame = new JFrame();
              WindowListener l = new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                             // Do here what you want ...                    }
              frame.addWindowListener(l);

  • Still having problem with closing frame---Help me

    How can I make frame closing by clicking with mouse on button 'x' in upper right corner of window?
    When I put this in constructor
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    I get error message:
    --------------------Configuration: j2sdk <Default>--------------------
    C:\javafile\Javabyexample\Projekat\Konverzija.java:17: cannot resolve symbol
    symbol : method setDefaultCloseOperation (int)
    location: class Konverzija
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    Help me

    if you just want to close the frame use setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)

  • Need help on closing frame

    I have a new frame that opens from a menu and I want to be able to push a button and have that frame (the frame the button is in) to close, kind of like a cancel button so you push cancel and nothing happens except the frame closes.
    Here is my code for this frame:
    public class Logout extends JFrame
        JPanel contentPane;
        BorderLayout borderLayout1 = new BorderLayout();
        GridBagLayout logoutGridBag = new GridBagLayout();
        JButton buttonLogout = new JButton();
        JButton buttonCancel = new JButton();
        public Logout()
            try
                jbInit();
            catch (Exception exception)
                exception.printStackTrace();
        private void jbInit() throws Exception
            contentPane = (JPanel) getContentPane();
            contentPane.setLayout(logoutGridBag);
            buttonLogout.setText("Logout");
            buttonCancel.setText("Cancel");
            //Cancel Logout, return to main menu
            buttonCancel.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent evt)
            contentPane.add(buttonCancel,
                            new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
                                                   , GridBagConstraints.SOUTHEAST,
                                                   GridBagConstraints.NONE,
                                                   new Insets(9, 10, 7, 3), 4, 51));
            contentPane.add(buttonLogout,
                            new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
                                                   , GridBagConstraints.NORTH,
                                                   GridBagConstraints.NONE,
                                                   new Insets(8, 16, 4, 17), 2, 52));
    }Thanks
    Scott

    Well not sure what else I can try to get this frame to close.As I said you should be using a JDialog not a JFrame
    Problem is that the whole application closes and not just the frame I have up.So create a [url http://www.physci.org/codes/sscce.jsp]Simple Executable Demo Program that shows this behaviour. That way we don't have to guess what you are doing. You should be able to do this in about 15-20 lines of code and you will learn alot:
    a) create a JFrame with a JButton on it.
    b) add code to the button to create a display a JDialog
    c) on the JDialog add a JButton to close the dialog
    Read the [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing Tutorial if you need help with any of these basic steps to GUI building.

  • Help!!! closing frame from panel

    Hi!
    does anybody know how to close(dispose) JFrame from JPanel button (JFrame contains JPanel with button)
    thank you

    Also same for you too PaulFMendler. This is now
    windows :D Quit being so polite and just shut the
    window!
    aFrame.dispose()The code I posted is a typical listener for the "Exit" menuitem. There it pays to be polite! For example:
    1. Set your JFrame's defaultCloseOperation to DO_NOTHING_ON_CLOSE
    2. Have a WindowListener that responds to windowClosing by checking to see if your "document" object is modified. If so, give the user a chance to save/not save the document, or to "cancel" and not close the window.
    You need 1 and 2 in any case, if your JFrame has that pesky close button.
    --Nax

  • Problem in Closing Browser window from an Applet.

    I have wriiten a small Applet progarm that calls a Javascript function in the opening window, to close the window in which it is loaded.The Applet window is a PopUp window from one of my application's window.
    First time I start my application and load that Applet and then close the frame window,it works fine that the browser window will close, when the frame window is closed.It calls the window closing event in that applet stop method is called and In stop methd a closeLaunchedBrowser method will called this has a Javascript method and the Method closes the window using the self.close() method.
    But now if I continue this process of launching applet and then closing frame window, initial 1 or 2 steps it has know problem when I continue this, after 3 or 4 steps, it result in browser hang/crash.
    I am using java version 1.4.2_01 or higher and IE or Firefox(any other NetScape based) browser to load applet.It works fine with IE but getting problem in case of Firefox(any other NetScape based).
    The error dialog information and related event log generated is shown below :
    The dialog which is displayed before crashing of firefox has information :
    "firefox.exe has generated errors and it will closed by windows.you will need to restart the program.
    An error log is being created."
    The error log information :
    Source : Browser Event ID: 8032
    "The browser service has failed to retrieve the backup list too many times on transport \Device\NetBT_Tcpip_{611A64A2-8F4B-409E-9AB2-0D9BF741E791}. The backup browser is stopping.
    The code related to this is given below.
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet {
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    TestApplet.this.stop();
    frame.show();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    }If any one know solution regarding how to aviod this crash of browser please let me know. I will be very thankful to you.
    Thanks.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Window closing error

    i written a java program for swing form. the form having default window close button. if i click on close button i displayed a dialog contained Yes-No-Calcel . if i click on cancel it will be exit. How can i stop the window closing.

    Look at this codes:
    import java.awt.event.*;
    import javax.swing.*;
    public class ClosingFrame extends JFrame {
         public ClosingFrame() {
              super("Closing frame");
              setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        int res = JOptionPane.showConfirmDialog(ClosingFrame.this, "Do you want to quit?", "Exit", JOptionPane.YES_NO_OPTION);
                        if (res == JOptionPane.YES_OPTION) {
                             System.out.println("Bye");
                             System.exit(0);
                        else {
                             System.out.println("So you stay!");
              setSize(200,200);
              setLocationRelativeTo(null);
              setVisible(true);
         public static void main(String[] args) {
              new ClosingFrame();
    }Denis

  • Problem with using JMF audio over a network

    Hiya, I'm using IBM JMF code but I'm having problems trying to get it transmit data from the MediaTransmitter to the MediaPlayerFrame.
    I'm kinda new to JMF so I assume I'm missing something basis for why this doesn't work.
    Any help would be greatly appreciated.
    MediaPlayerFrame
    import javax.media.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    * An instance of the MediaPlayerFrame may be used to display any media
    * recognized * by JMF.  This is intended to be a very simple GUI example,
    * displaying all possible controls for the given media type.
    public class MediaPlayerFrame extends JFrame {
         * The frame title.
        private static final String FRAME_TITLE = "developerWorks JMF Tutorial " +
            "Media Player";
         * The panel title of the main control panel.
        private static final String CONTROL_PANEL_TITLE = "Control Panel";
        // location and size variables for the frame.
        private static final int LOC_X = 100;
        private static final int LOC_Y = 100;
        private static final int HEIGHT = 500;
        private static final int WIDTH = 500;
         private final static long serialVersionUID = 1;
         * The current player.
        private Player player = null;
         * The tabbed pane for displaying controls.
        private JTabbedPane tabPane = null;
         * Create an instance of the media frame.  No data will be displayed in the
         * frame until a player is set.
        public MediaPlayerFrame() {         
            super(FRAME_TITLE);
            System.out.println("MediaPlayerFrame");
            setLocation(LOC_X, LOC_Y);
            setSize(WIDTH, HEIGHT);
            tabPane = new JTabbedPane();
            getContentPane().add(tabPane);
            /* adds a window listener so that the player may be cleaned up before
               the frame actually closes.
            addWindowListener(new WindowAdapter() {
                                   * Invoked when the frame is being closed.
                                  public void windowClosing(WindowEvent e) {
                                      closeCurrentPlayer(); 
                                      /* Closing this frame will cause the entire
                                         application to exit.  When running this
                                         example as its own application, this is
                                         fine - but in general, a closing frame
                                         would not close the entire application. 
                                         If this behavior is not desired, comment
                                         out the following line:
                                      System.exit(0);
         * Creates the main panel.  This panel will contain the following if they
         * exist:
         * - The visual component: where any visual data is displayed, i.e. a
         * movie uses this control to display the video.
         * - The gain component:   where the gain/volume may be changed.  This
         * is often * contained in the control panel component (below.)
         * - The control panel component: time and some extra info regarding
         * the media.
        private JPanel createMainPanel() {
            System.out.println("createMainPanel");
            JPanel mainPanel = new JPanel();
            GridBagLayout gbl = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            mainPanel.setLayout(gbl);
            boolean visualComponentExists = false;
            // if the visual component exists, add it to the newly created panel.
            if (player.getVisualComponent() != null) {
                visualComponentExists = true;
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
                gbc.fill = GridBagConstraints.BOTH;
                mainPanel.add(player.getVisualComponent(), gbc);
            // if the gain control component exists, add it to the new panel.
            if ((player.getGainControl() != null) &&
                (player.getGainControl().getControlComponent() != null)) {
                gbc.gridx = 1;
                gbc.gridy = 0;
                gbc.weightx = 0;
                gbc.weighty = 1;
                gbc.gridheight = 2;
                gbc.fill = GridBagConstraints.VERTICAL;
                mainPanel.add(player.getGainControl().getControlComponent(), gbc);
            // Add the control panel component if it exists (it should exists in
            // all cases.)
            if (player.getControlPanelComponent() != null) {
                gbc.gridx = 0;
                gbc.gridy = 1;
                gbc.weightx = 1;
                gbc.gridheight = 1;
                if (visualComponentExists) {
                    gbc.fill = GridBagConstraints.HORIZONTAL;
                    gbc.weighty = 0;
                } else {
                    gbc.fill = GridBagConstraints.BOTH;
                    gbc.weighty = 1;
                mainPanel.add(player.getControlPanelComponent(), gbc);
            return mainPanel;
         * Sets the media locator.  Setting this to a new value effectively
         * discards any Player which may have already existed.
         * @param locator the new MediaLocator object.
         * @throws IOException indicates an IO error in opening the media.
         * @throws NoPlayerException indicates no player was found for the
         * media type.
         * @throws CannotRealizeException indicates an error in realizing the
         * media file or stream.
        public void setMediaLocator(MediaLocator locator) throws IOException,
            NoPlayerException, CannotRealizeException {
              System.out.println("setMediaLocator: " +locator);
            // create a new player with the new locator.  This will effectively
            // stop and discard any current player.
            setPlayer(Manager.createRealizedPlayer(locator));       
         * Sets the player reference.  Setting this to a new value will discard
         * any Player which already exists.  It will also refresh the contents
         * of the pane with the components for the new player.  A null value will
         * stop the discard the current player and clear the contents of the
         * frame.
        public void setPlayer(Player newPlayer) {      
            System.out.println("setPlayer");
            // close the current player
            closeCurrentPlayer();          
            player = newPlayer;
            // refresh the tabbed pane.
            tabPane.removeAll();
            if (player == null) return;
            // add the new main panel
            tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());
            // add any other controls which may exist in the player.  These
            // controls should already contain a name which is used in the
            // tabbed pane.
            Control[] controls = player.getControls();
            for (int i = 0; i < controls.length; i++) {
                if (controls.getControlComponent() != null) {
    tabPane.add(controls[i].getControlComponent());
    * Stops and closes the current player if one exists.
    private void closeCurrentPlayer() {
    if (player != null) {
    player.stop();
    player.close();
    * Prints a usage message to System.out for how to use this class
    * through the command line.
    public static void printUsage() {
    System.out.println("Usage: java MediaPlayerFrame mediaLocator");
    * Allows the user to run the class through the command line.
    * Only one argument is allowed, which is the media locator.
    public static void main(String[] args) {
    try {
    if (args.length == 1) {
    MediaPlayerFrame mpf = new MediaPlayerFrame();
    /* The following line creates a media locator using the String
    passed in through the command line. This version should
    be used when receiving media streamed over a network.
    mpf.setMediaLocator(new MediaLocator(args[0]));
    /* the following line may be used to create and set the media
    locator from a simple file name. This works fine when
    playing local media. To play media streamed over a
    network, you should use the previous setMediaLocator()
    line and comment this one out.
    //mpf.setMediaLocator(new MediaLocator(
    // new File(args[0]).toURL()));
    mpf.setVisible(true);
    } else {
    printUsage();
    } catch (Throwable t) {
    t.printStackTrace();
    MediaTransmitter
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import java.io.IOException;
    import java.io.File;
    * Creates a new media transmitter.  The media transmitter may be used to
    * transmit a data source over a network.
    public class MediaTransmitter {
         * Output locator - this is the broadcast address for the media.
        private MediaLocator mediaLocator = null;
         * The data sink object used to broadcast the results from the processor
         * to the network.
        private DataSink dataSink = null;
         * The processor used to read the media from a local file, and produce an
         * output stream which will be handed to the data sink object for
         * broadcast.
        private Processor mediaProcessor = null;
         * The track formats used for all data sources in this transmitter.  It is
         * assumed that this transmitter will always be associated with the same
         * RTP stream format, so this is made static.
        private static final Format[] FORMATS = new Format[] {
            new AudioFormat(AudioFormat.MPEG_RTP)};
         * The content descriptor for this transmitter.  It is assumed that this
         * transmitter always handles the same type of RTP content, so this is
         * made static.
        private static final ContentDescriptor CONTENT_DESCRIPTOR =
            new ContentDescriptor(ContentDescriptor.RAW_RTP);
         * Creates a new transmitter with the given outbound locator.
        public MediaTransmitter(MediaLocator locator) {
            mediaLocator = locator;
         * Starts transmitting the media.
        public void startTransmitting() throws IOException {
            // start the processor
            mediaProcessor.start();
            // open and start the data sink
            dataSink.open();
            dataSink.start();
         * Stops transmitting the media.
        public void stopTransmitting() throws IOException {
            // stop and close the data sink
            dataSink.stop();
            dataSink.close();
            // stop and close the processor
            mediaProcessor.stop();
            mediaProcessor.close();
         * Sets the data source.  This is where the transmitter will get the media
         * to transmit.
        public void setDataSource(DataSource ds) throws IOException,
            NoProcessorException, CannotRealizeException, NoDataSinkException {
            /* Create the realized processor.  By calling the
               createRealizedProcessor() method on the manager, we are guaranteed
               that the processor is both configured and realized already. 
               For this reason, this method will block until both of these
               conditions are true.  In general, the processor is responsible
               for reading the file from a file and converting it to
               an RTP stream.
            mediaProcessor = Manager.createRealizedProcessor(
                new ProcessorModel(ds, FORMATS, CONTENT_DESCRIPTOR));
            /* Create the data sink.  The data sink is used to do the actual work
               of broadcasting the RTP data over a network.
            dataSink = Manager.createDataSink(mediaProcessor.getDataOutput(),
                                              mediaLocator);
         * Prints a usage message to System.out for how to use this class
         * through the command line.
        public static void printUsage() {
            System.out.println("Usage: java MediaTransmitter mediaLocator " +
                               "mediaFile");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.72:49150/audio mysong.mp3");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.255:49150/audio mysong.mp3");
         * Allows the user to run the class through the command line.
         * Only two arguments are allowed; these are the output media
         * locator and the mp3 audio file which will be broadcast
         * in the order.
        public static void main(String[] args) {
            try {
                if (args.length == 2) {
                    MediaLocator locator = new MediaLocator(args[0]);
                    MediaTransmitter transmitter = new MediaTransmitter(locator);
                    System.out.println("-> Created media locator: '" +
                                       locator + "'");
                    /* Creates and uses a file reference for the audio file,
                       if a url or any other reference is desired, then this
                       line needs to change.
                    File mediaFile = new File(args[1]);
                    DataSource source = Manager.createDataSource(
                        new MediaLocator(mediaFile.toURL()));
                    System.out.println("-> Created data source: '" +
                                       mediaFile.getAbsolutePath() + "'");
                    // set the data source.
                    transmitter.setDataSource(source);
                    System.out.println("-> Set the data source on the transmitter");
                    // start transmitting the file over the network.
                    transmitter.startTransmitting();
                    System.out.println("-> Transmitting...");
                    System.out.println("   Press the Enter key to exit");
                    // wait for the user to press Enter to proceed and exit.
                    System.in.read();
                    System.out.println("-> Exiting");
                    transmitter.stopTransmitting();
                } else {
                    printUsage();
            } catch (Throwable t) {
                t.printStackTrace();
            System.exit(0);

    Okay, here's the it copied out.
    Media Transmitter
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaTransmitter rtp://127.0.
    0.1:2000/audio it-came-upon.mp3
    -> Created media locator: 'rtp://127.0.0.1:2000/audio'
    -> Created data source: 'C:\John\Masters Project\Java\jmf1\MediaPlayer\it-came-u
    pon.mp3'
    streams is [Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@1decd
    ec : 1
    sink: setOutputLocator rtp://127.0.0.1:2000/audio
    -> Set the data source on the transmitter
    -> Transmitting...
       Press the Enter key to exit
    MediaPlayerFrame
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaPlayerFrame rtp://127.0.
    0.1:2000/audio
    MediaPlayerFrame
    setMediaLocator: rtp://127.0.0.1:2000/audioAs I said, it just kinda stops there, what it should be doing is opening the MediaPlayer.
    "MediaPlayerFrame" and "setMediaLocator: rtp://127.0.0.1:2000/audio" are just print outs I used to track here the code is getting to.

  • Java.awt.Container.add(Container.java:345) how can i handle this

    dear all,
    i want to design an outlook for a chat applet. but this seems to tough as i am getting a run time error
    my code is:
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    * the import that are required for this class
    public class outer extends Frame //implements ActionListener, Runnable
    private TextField txtusername,txtpassword,txtroomname;
    private Label lblusername,lblpassword,lblroomname,lbllistofrooms;
    Button okBtn,exitBut;
    Color backColor=null,btnBackClr=null,btnForeClr=null;
    String[] roomsavailable = {" one ", " two ", " three", " four"};
    private JList rooms = new JList(roomsavailable);
    /** the costructor*/
    public outer()
    { // super(st);
    backColor=new Color(200,200,255);
    btnBackClr=new Color(225,240,255);
    btnForeClr=new Color(205,205,205);
    setBackground(backColor);
    setLayout(null);
    lblusername = new Label("Username");
    lblusername.reshape(insets().left+5,insets().top+10,60,20);
    add(lblusername);
    txtusername=new TextField();
    txtusername.reshape(insets().left+75,insets().top+10,60,20);
    add(txtusername);
    lblpassword = new Label("Password");
    lblpassword.reshape(insets().left+5,insets().top+30,60,20);
    add(lblpassword);
    txtpassword=new TextField();
    txtpassword.reshape(insets().left+75,insets().top+30,60,20);
    add(txtpassword);
    lblroomname = new Label("Select Room");
    lblroomname.reshape(insets().left+5,insets().top+50,60,20);
    add(lblroomname);
    txtroomname=new TextField();
    txtroomname.reshape(insets().left+75,insets().top+50,60,20);
    add(txtroomname);
    okBtn=new Button("Login");
    okBtn.reshape(insets().left+25,insets().top+80,60,20);
    add(okBtn);
    // okBtn.addActionListener(this);
    exitBut=new Button("EXIT");
    exitBut.reshape(insets().left+50,insets().top+80,60,20);
    add(exitBut);
    // exitBut.addActionListener(this);
    public static void main(String[] args)
    // Create a JFrame
    JFrame frame = new JFrame("client side");
    // Create a outer class object
    outer outerobj = new outer();
    // Add the outer to the JFrame
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    // Set Jframe size
    frame.setSize(800, 400);
    //set resizable true
    frame.setResizable(true);
    // Set JFrame to visible
    frame.setVisible(true);
    // set the close operation so that the Application terminates when closed
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    when i compile it it compiles but gives run time error like this
    RUN TIME error:
    Exception in thread "main" java.lang.IllegalArgumentException: adding a window
    to a container
    at java.awt.Container.addImpl(Container.java:434)
    at java.awt.Container.add(Container.java:345)
    at outer.main(outer.java:75)
    Press any key to continue...
    i know erroe in this line
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    but how shall i add to get the proper layout by getting benifit of insets method
    reply soon
    please

    You can't add a frame to a frame.
    Try chaing the class definition from
    public class outer extends Frameto
    public class outer extends PanelPlease note to format your code (you'll get a faster response) use [ code]
    Object names should always start with a capital letter. outer --> Outer

  • Using IO to create a Combo Box

    Hello,
    I have failed to find any examples on how to do the following, and have not yet figured out how to do it msyelf.
    I want to add the entire contents of a file containg a list of people's personal numbers and their names to a combo box that is then added to the frame.
    Here is the code: -
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    public class IOCombo extends JFrame
    implements ActionListener {
    public JButton b1;
    public JPanel panel, panel_top, panel_office;
    public JFrame frame;
    public JLabel officeLabel, personLabel, buttonWorkedLabel;
    String OfficeChosen;
    String[] Office = {"London", "Paris", "NYC"};
    String[] OfficeList;
    int[] personalNumber;
    public IOCombo() {
    frame = new JFrame("IOCombo Test");
    panel_top = new JPanel();
    panel_office = new JPanel();
    panel = new JPanel();
    officeLabel = new JLabel("The Office is in ");
    personLabel = new JLabel(".");
    buttonWorkedLabel = new JLabel(".");
    // Exit when the window is closed.
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    b1 = new JButton("Office");
    b1.setVerticalTextPosition(AbstractButton.CENTER);
    b1.setHorizontalTextPosition(AbstractButton.LEFT);
    b1.setMnemonic(KeyEvent.VK_O);
    //Listen for actions
    b1.addActionListener(this);
    //tooltips for buttons
    b1.setToolTipText("Choose an Office and a person and then click to edit that Office's Person.");
    JComboBox office = new JComboBox(Office);
    office.setSelectedIndex(0);
         office.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
         JComboBox cb = (JComboBox)e.getSource();
         OfficeChosen = (String)cb.getSelectedItem();
    try
    whichOffice(OfficeChosen);
    catch(IOException ex)
    //set layout of all panels and add them to frame.
    panel_office.add(officeLabel);
    panel_office.add(office);
    panel_office.add(personLabel);
    panel_top.setLayout(new FlowLayout());
    panel_top.add(b1);
    panel_top.add(buttonWorkedLabel);
         panel.setLayout(new GridLayout(3,0));
    panel.add(panel_office);
    panel.add(panel_top);
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    String buttonPressed = e.getActionCommand();
    if (buttonPressed.equals("Office"))
    /**This is just a test, removed the Dialog class to
    manipulate the office*/
    buttonWorkedLabel.setText("Worked");
    else {
    /** How do I set-up the combo box using the Office Person chosen from the
    file and allocate it to the frame?*/
    public void whichOffice(String OfficeChos)throws IOException{
    officeLabel.setText("The Office chosen is: " + OfficeChos);
    String s, name ="";
    int personalNum;
    BufferedReader fr = null;
    fr = new BufferedReader(new FileReader (OfficeChos+".txt"));
    while ((s=fr.readLine()) != null)
    StringTokenizer st = new StringTokenizer (s," ");
    personalNum = Integer.parseInt(st.nextToken());
    st.nextToken();
    name = st.nextToken() + " " + st.nextToken();
    personLabel.setText(personalNum + " " + name);
    /** This method only works if the file contains person
    how should I change this to read everyone in?
    I want to add the entire contents of personal number and name
    of the file to a combo box that is then added to the frame.
    public static void main(String[] args) {
    IOCombo iocombo = new IOCombo();
    The file I have set-up currently that works is called "London.txt" and it contains: -
    1 = John Smith
    Cheers in advance,
    Richard.

    Hi,
    Sorry I cannot get the code you provided to work, not sure if its your code or the ways I have tried to implement it. Please can you check into it and if it works give the completed code.
    Reprovided code with formating :-)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    public class IOCombo extends JFrame
                            implements ActionListener {
        public JButton b1;
        public JPanel panel, panel_top, panel_office;
        public JFrame frame;
        public JLabel officeLabel, personLabel, buttonWorkedLabel;
        String OfficeChosen;
        String[] Office = {"London", "Paris", "NYC"};
        String[] OfficeList;
        int[] personalNumber;
        public IOCombo() {
            frame = new JFrame("IOCombo Test");
            panel_top = new JPanel();
            panel_office = new JPanel();
            panel = new JPanel();    
            officeLabel = new JLabel("The Office is in ");
            personLabel = new JLabel(".");
            buttonWorkedLabel = new JLabel(".");
    // Exit when the window is closed.
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            b1 = new JButton("Office");
            b1.setVerticalTextPosition(AbstractButton.CENTER);
            b1.setHorizontalTextPosition(AbstractButton.LEFT);
            b1.setMnemonic(KeyEvent.VK_O);
    //Listen for actions
            b1.addActionListener(this);
    //tooltips for buttons
            b1.setToolTipText("Choose an Office and a person and then click to edit that Office's Person.");
            JComboBox office = new JComboBox(Office);
            office.setSelectedIndex(0);
         office.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                         JComboBox cb = (JComboBox)e.getSource();
                         OfficeChosen = (String)cb.getSelectedItem();
                            try
                                whichOffice(OfficeChosen);
                            catch(IOException ex)
    //set layout of all panels and add them to frame.
            panel_office.add(officeLabel);
            panel_office.add(office);
            panel_office.add(personLabel);
            panel_top.setLayout(new FlowLayout());
            panel_top.add(b1);
            panel_top.add(buttonWorkedLabel);
         panel.setLayout(new GridLayout(3,0));
            panel.add(panel_office);
            panel.add(panel_top);
            frame.getContentPane().add(panel);
            frame.pack();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            String buttonPressed = e.getActionCommand();
            if (buttonPressed.equals("Office"))
                    /**This is just a test, removed the Dialog class to
                     manipulate the office*/
                    buttonWorkedLabel.setText("Worked");
            else {
                /** How do I set-up the combo box using the Office Person chosen from the
                 file and allocate it to the frame?*/
        public void whichOffice(String OfficeChos)throws IOException{
            officeLabel.setText("The Office chosen is: " + OfficeChos);
            String s, name ="";
            int personalNum;
            BufferedReader fr = null;
            fr = new BufferedReader(new FileReader ("c:\\java\\kjc\\set\\"+OfficeChos+".txt"));
            while ((s=fr.readLine()) != null)
                    StringTokenizer st = new StringTokenizer (s," ");
                    personalNum = Integer.parseInt(st.nextToken());
                    st.nextToken();
                    name = st.nextToken() + "  " + st.nextToken();
                    personLabel.setText(personalNum + " " + name);
                    /** This method only works if the file contains person
                     how should I change this to read everyone in?
                     I want to add the entire contents of personal number and name
                     of the file to a combo box that is then added to the frame.
        public static void main(String[] args) {
            IOCombo iocombo = new IOCombo();
    }Cheers,
    Richard

  • Newbie Please Help!

    Is there a way in which I can run the following program from within an HTML web site.
    The code is from
    /* From http://java.sun.com/docs/books/tutorial/index.html */
    However I have changed some of it and wish to run it from within a web-site I am building.
    Is there a way to do this?
    Thanks for any input. Remember I am new to java so forgive me in advance if this is the wrong forum.
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.applet.*;
    public class troubleShooter extends JPanel {
    JLabel label;
    JFrame frame;
    String simpleDialogDesc = "Options";
    public troubleShooter(JFrame frame) {
    this.frame = frame;
    JLabel title;
    // Create the components.
    JPanel choicePanel = createSimpleDialogBox();
    System.out.println("passed createSimpleDialogBox");
    title = new JLabel("Click \"Submit\" When"
    + " you have selected a option.", JLabel.CENTER);
    label = new JLabel("Messages will appear here!", JLabel.CENTER);
    label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    choicePanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 5, 20));
    // Set the layout.
    setLayout(new BorderLayout());
    add(title, BorderLayout.NORTH);
    add(label, BorderLayout.SOUTH);
    add(choicePanel, BorderLayout.CENTER);
    void setLabel(String newText) {
    label.setText(newText);
    private JPanel createSimpleDialogBox() {
    final int numButtons = 4;
    JRadioButton[] radioButtons = new JRadioButton[numButtons];
    final ButtonGroup group = new ButtonGroup();
    JButton submitButton = null;
    final String defaultMessageCommand = "default";
    final String yesNoCommand = "yesno";
    final String yeahNahCommand = "yeahnah";
    final String yncCommand = "ync";
    radioButtons[0] = new JRadioButton( "<html>Software :</html>");
    radioButtons[0].setActionCommand(defaultMessageCommand);
    radioButtons[1] = new JRadioButton(
    "<html>My printout quality is poor: </html>");
    radioButtons[1].setActionCommand(yesNoCommand);
    radioButtons[2] = new JRadioButton(
    "<html>Candidate 3: <font color=blue>R.I.P. McDaniels</font></html>");
    radioButtons[2].setActionCommand(yeahNahCommand);
    radioButtons[3] = new JRadioButton(
    "<html>Candidate 4: <font color=maroon>Duke the Java<font size=-2><sup>TM</sup></font size> Platform Mascot</font></html>");
    radioButtons[3].setActionCommand(yncCommand);
    for (int i = 0; i < numButtons; i++) {
    group.add(radioButtons);
    // Select the first button by default.
    radioButtons[0].setSelected(true);
    submitButton = new JButton("Submit");
    submitButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    String command = group.getSelection().getActionCommand();
    // ok dialog
    if (command == defaultMessageCommand) {
    JOptionPane.showMessageDialog(frame,
    "This candidate is a dog. Invalid vote.");
    // yes/no dialog
    else if (command == yesNoCommand) {
    int a = JOptionPane
    .showConfirmDialog(frame,"Are you using the correct type of paper? \nTo specify paper type:\n1. Click Start-Control Panel-Printers & Hardware.\n2. Right-click the printer icon and then click Printing Preferences.\n3. Click the Paper/Quality tab.\n4. Select Paper type (ie Photo paper for photos)\n\nDoes this solve the problem?","Follow-up Question",JOptionPane.YES_NO_OPTION);
    if (a == JOptionPane.YES_OPTION) {
    setLabel("Happy printing!");
    else if (a == JOptionPane.NO_OPTION) {
    int b = JOptionPane.showConfirmDialog(frame,"Is your printer working correctly?\n1.Refer to printer documetation for maintenance procedures.\n2. Clean the print heads.\n3. Re-align the print heads.\n4. Check the colour range.\n5. Install new ink cartridges.\n\nDoes this solve the problem?","Follow-up Question",JOptionPane.YES_NO_OPTION);
    if (b == JOptionPane.YES_OPTION) {
    setLabel("Happy printing!");
    if (b == JOptionPane.NO_OPTION) {
    int c = JOptionPane.showConfirmDialog(frame,"Is your printer fucked?","Follow-up Question",JOptionPane.YES_NO_OPTION);
    else {
    setLabel("Please try another option.");
    // yes/no (with customized wording)
    else if (command == yeahNahCommand) {
    Object[] options = { "Yes, please", "No, thanks" };
    int n = JOptionPane
    .showOptionDialog(
    frame,
    "This candidate is deceased. \nDo you still want to vote for him?",
    "A Follow-up Question",
    JOptionPane.YES_NO_OPTION,
    JOptionPane.QUESTION_MESSAGE, null,
    options, options[0]);
    if (n == JOptionPane.YES_OPTION) {
    setLabel("I hope you don't expect much from your candidate.");
    } else if (n == JOptionPane.NO_OPTION) {
    setLabel("Whew! Good choice.");
    } else {
    setLabel("Please try another option.");
    // yes/no/cancel (with customized wording)
    } else if (command == yncCommand) {
    Object[] options = { "Yes!", "No, I'll pass",
    "Well, if I must" };
    int n = JOptionPane.showOptionDialog(frame,
    "Duke is a cartoon mascot. \nDo you "
    + "still want to cast your vote?",
    "A Follow-up Question",
    JOptionPane.YES_NO_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE, null, options,
    options[2]);
    if (n == JOptionPane.YES_OPTION) {
    setLabel("Excellent choice.");
    } else if (n == JOptionPane.NO_OPTION) {
    setLabel("Whatever you say. It's your vote.");
    } else if (n == JOptionPane.CANCEL_OPTION) {
    setLabel("Well, I'm certainly not going to make you vote.");
    } else {
    setLabel("Please try another option.");
    return;
    System.out.println("calling createPane");
    return createPane(simpleDialogDesc + ":", radioButtons, submitButton);
    private JPanel createPane(String description, JRadioButton[] radioButtons,
    JButton showButton) {
    int numChoices = radioButtons.length;
    JPanel box = new JPanel();
    JLabel label = new JLabel(description);
    box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
    box.add(label);
    for (int i = 0; i < numChoices; i++) {
    box.add(radioButtons[i]);
    JPanel pane = new JPanel();
    pane.setLayout(new BorderLayout());
    pane.add(box, BorderLayout.NORTH);
    pane.add(showButton, BorderLayout.SOUTH);
    System.out.println("returning pane");
    return pane;
    public static void main(String[] args) {
    JFrame frame = new JFrame("Printer Troubleshooter");
    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(1, 1));
    contentPane.add(new troubleShooter(frame));
    // Exit when the window is closed.
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);

    Make it an applet.

  • In Japanese locale setVisible(true) consumes large memory

    In JAPANESE locale - Swap space/memory usage grows enormously when setVisible(true) method is called.
    Problem :
    We are developing / converting a product in JAVA built with AWT components in JAPANESE locale. While testing our product, we observed that memory usage (Total VSS column in EnglishResult.txt & JapaneseResult.txt) and Swap space used growing continuously using ?GLANCE? tool, and it was found that setVisible(true) (For any component like Frame, Dialog etc.,) method consumes large amount of memory.
    To ensure this problem, the following ?Operation Memory? test was carried out with a sample application in the below mentioned combination of configuration and platforms.
    Java Language : JRE 1.3.1 (Hotspot Client) , JRE 1.2.2 , JRE 1.1.8
    Locale : Japanese (ja , ja_JP.PCK , ja_JP.UTF-8 , ja_JP.EUCJP , Japanese)
    OS          : Solaris 8 ? 256 MB RAM , Swap Space 1 GB
    Operation Memory:
    1.     Execute the application
    2.     Press the ?Show? button
    3.     After a dialog is appeared , press the ?Hide? button
    4.     Repeat the steps 2 & 3 for 3 times.
    5.     Repeat step 4 for 3 times.
    The data is collected at the following points using GLANCE tool and the result is shown in EnglishResult.txt (Data of English Locale), JapaneseResult.txt (Data of Japanese locale).
    1.     After Step 1
    2.     After Step 4 ( 3 times)
    In the attached result it is found that for every 3 times of opening and closing the dialog , there is an increase of 1 MB of swap space used & Total VSS , where as in the original product that we have developed , for every opening and closing of dialog there is an increase of 7MB ,
    We observed the ?memory growing? behavior in all JRE versions and all Japanese locales .How ever we attaching data collected only in JRE 1.3.1, ja_JP.EUCJP, Solaris 8.
    using GLANCE tool.
    1)ResultJapanese.Txt ? Data collected in Japanese locale
    2)ResultEnglish.Txt - Data collected in English Locale
    This behavior is NOT observed if the locale is set to English.
    Kindly suggest us to overcome the above said problem in JAPANESE locale.
    Sample Java Code (Mem.java)
    import java.awt.*;
    import java.awt.event.*;
    public class mem
         public static void main(String arg[])
              showframe sf = new showframe();
              sf.setSize(300,300);
              sf.show();
    class showframe extends Frame implements ActionListener
         Button b1,b2;
         tpframe tpf ;
         showframe()
              tpf = new tpframe();
              b1 = new Button("show");
              b2 = new Button("hide");
              setLayout(new FlowLayout());
              add(b1);     add(b2);
              b1.addActionListener(this);
              b2.addActionListener(this);
         public void actionPerformed(ActionEvent ae)
              if(ae.getSource()==b1)
                   tpf = new tpframe();
                   tpf.setVisible(true);
              if(ae.getSource()==b2)
                   tpf.setVisible(false);
    class tpframe extends Frame
         TextField tx1,tx2,tx3,tx4 ;
         tpframe()
              Panel p1 = new Panel();
              Label lb1 = new Label("first tab panel");
              tx1 = new TextField("ONEONE");
              tx2 = new TextField("ONEONE");
              tx3 = new TextField("ONEONE");
              tx4 = new TextField("ONEONE");
              p1.setLayout(new FlowLayout());
              p1.add(lb1);
    p1.add(tx1);p1.add(tx2);
    p1.add(tx3);p1.add(tx4);
              add(p1,BorderLayout.CENTER);
              setSize(300,300);
    JapaneseResult.txt (Data collected using GLANCE tool in Japanese locale)
    ========================================================================
    B3694A GlancePlus C.03.10.00 04:17:58 nucleus sun4m Current Avg High
    CPU Util S SUU | 16% 22% 60%
    Disk Util | 0% 1% 3%
    Mem Util SSU U | 42% 42% 42%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.8mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 144mb Other VSS: 27mb Total VSS: 37mb
    B3694A GlancePlus C.03.10.00 04:17:58 nucleus sun4m Current Avg High
    CPU Util S SUU | 16% 22% 60%
    Disk Util | 0% 1% 3%
    Mem Util SSU U | 42% 42% 42%
    Swap Util U URR | 12% 11% 12%
    SWAP SPACE Users= 6
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 64mb
    Swap Avail: 738mb Swap Used: 64mb Resvd Util (%): 12 Swap Reserved: 85mb
    *********** after the dialog is shown for the first time ***********
    B3694A GlancePlus C.03.10.00 04:19:22 nucleus sun4m Current Avg High
    CPU Util SSUU | 6% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 42% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 4.0mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 145mb Other VSS: 27mb Total VSS: 38mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 66mb
    Swap Avail: 738mb Swap Used: 66mb Resvd Util (%): 12 Swap Reserved: 88mb
    *********** after opening and closing the dialog 3 times ********
    B3694A GlancePlus C.03.10.00 04:20:25 nucleus sun4m Current Avg High
    CPU Util S SU U | 18% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 42% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 4.9mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 146mb Other VSS: 27mb Total VSS: 39mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 67mb
    Swap Avail: 738mb Swap Used: 67mb Resvd Util (%): 12 Swap Reserved: 89mb
    **************** opening and closing for next 3 times ( total 6 times ) **********
    B3694A GlancePlus C.03.10.00 04:21:26 nucleus sun4m Current Avg High
    CPU Util S SUU | 9% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 43% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 5.8mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 147mb Other VSS: 27mb Total VSS: 40mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 67mb
    Swap Avail: 738mb Swap Used: 67mb Resvd Util (%): 12 Swap Reserved: 89mb
    *********** after opening and closing the dialog 3 more times ( total 9 times )********
    EnglishResult.Txt (Data collected using GLANCE Tool in English locale)
    B3694A GlancePlus C.03.10.00 04:01:33 nucleus sun4m Current Avg High
    CPU Util S SUU | 17% 36% 100%
    Disk Util DD | 3% 1% 3%
    Mem Util SSU U | 35% 34% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.0mb 0xe8000000 <shmem>
    SHMEM /S 1 30.0mb 0xe8200000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 35mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    ************* after the dialog was opened for the first time **********
    B3694A GlancePlus C.03.10.00 04:03:39 nucleus sun4m Current Avg High
    CPU Util SSUU | 7% 19% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    ************ after open and close of dialog for 3 times **********
    B3694A GlancePlus C.03.10.00 04:05:38 nucleus sun4m Current Avg High
    CPU Util S SU U | 38% 15% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    *********** after opening and closing the dialog for next 3 times ( total-6 times) **********
    B3694A GlancePlus C.03.10.00 04:07:46 nucleus sun4m Current Avg High
    CPU Util SSU | 5% 13% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    *********** after open and close of dialog for the next 3 times ( total-9 times ) *********

    I have the same problem!
    Our program chews up memory like there is no tomorrow when opening and closing frames....
    I will try to start a new thread in this forum explaining our problems a bit more in depth. I have a strange feeling that the garbage collector doesn't do it's job as supposed to.

  • Quick movements mess up my variables

    I have an interactive map with multiple hotspots on it.  When the user mouses over a hotspot (Button) a value is assigned to a variable (country).  The actionscript (AS2) is also told to go to a frame performing a close sequence on the currently open animation.
    so if userA has moused over Brazil the following AS is on the Brazil button:
    on(rollOver) {
        if(country != 'brazil') {
            gotoAndPlay(country+'-close');  //goes to closing sequence for currently selected country
            var country = 'brazil';
    once the timeline hits the last frame of the close sequence the following AS is on the last frame of the sequence:
    gotoAndPlay(country);
    (each country has a frame labeled for it on the timeline with an opening/hold/closing frame sequence.)
    my problem arises if a user mouses over one country and in the middle of the 3 frame opening/closing sequence they quickly mouse over another country, it seems like the variables get 'screwed up.'  the variable appears to lag, so when the user mouses over countryA, then countryB to countryC very quickly, countryB will be highighted and remain highlighted until i mouse over countryA again (and then it will go to countryC).  [i know this is a bit confusing, but hopefully it makes sense to someone else]
    does anyone have any suggestions on how to eliminate this issue?  i only have 5 regions, and the file size of the swf is small (160kB), so I dont understand the lagging and breaking.
    thanks in advance for any help.
    (i've attached the exported swf file so you can see what i'm rambling about)

    Well, /bin, and /usr/bin are in the basic PATH defined in /etc/profile, or at least they should be.
    Unless you've modified your PATH settings in any way, and excluded those two default locations, they should work on reboot.
    Last edited by Xabre (2011-03-24 11:35:09)

  • JTable help:- Setting Table Header and scrollbar

    hi
    everybody.
    i have create a table which is getting the data from URL Connection by parsing the XML file.
    All is working fine but the only problem is that i am not able to set the column headers.
    and also want to set scrollbars to my table because the data in my table is long.
    i have tried with JTableHeader and TableModel, but i am confused with it.
    so can anybody solve my problem.
    i am sending my code for creating table, and also sending the file from which the data is retrieved.
    please go through the code and reply me.
    If u are not able to parse the xml file than simply removed that part and using the QUERYResp.txt which i have attached, because i think the URL which i am using will not be accessed other than my network
    waiting for reply.
    //SelectPrivilege.java
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.w3c.dom.*;
    import java.net.*;
    import java.util.*;
    public class SelectPrivilege extends JFrame implements ActionListener
         JFrame frame;
         JTable table;
         JPanel buttonpanel;
         JButton openbutton,donebutton;
         String strclassname,strmembertype,strpasswordduration,strclassdescription;
        private boolean ALLOW_ROW_SELECTION = true;
        ListSelectionModel rowSM;
         Document document;
         Node node;
         NodeList employees,children;
         Element employee;
         String inputline,strSuccess;
         URL url;
         URLConnection connection;
         FileInputStream fis;
         DataInputStream dis;
         String objid,classname,membertype,passwordexp,description,finalstring;
         StringTokenizer st;
         String strurl = "<CLFAPP><CLFYAPP_MSG_TYPE_MSG_TYPE>QUERY</CLFYAPP_MSG_TYPE_MSG_TYPE><TABLE>PRIVCLASS</TABLE><FIELDS>OBJID,CLASS_NAME,MEMBER_TYPE,PSWRD_EXP_PER,DESCRIPTION</FIELDS><FILTER></FILTER></CLFYAPP>";
         public SelectPrivilege()
              JFrame.setDefaultLookAndFeelDecorated(true);
              frame = new JFrame("Select Privilege Class");
              try
                   url = new URL("http://10.8.54.55:7002/RILClarifyAppRequest?XML=" + strurl);
                   connection = url.openConnection();
                   BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                   FileOutputStream out = new FileOutputStream("QUERYResp.xml");
                   PrintStream p = new PrintStream(out);
                   while ((inputline = reader.readLine()) != null)
                        System.out.println("Response Received......");
                        p.println(inputline);
                   p.close();
                   reader.close();
              catch(MalformedURLException e)
                   System.out.println(e.getCause());
              catch(IOException e)
                   System.out.println(e.getCause());
              //Parsing XML
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              try
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   document = builder.parse(new File("QUERYResp.xml"));
                   node = document.getDocumentElement();
                   employees = document.getElementsByTagName("RECORD");
                   FileOutputStream out = new FileOutputStream("QUERYResp.txt");
                   PrintStream p = new PrintStream(out);
                   for(int i = 0; i < employees.getLength(); i++)
                        final Element employee = (Element)employees.item(i);
                        p.print(getValueOf(employee,"OBJID"));
                        p.print("#");
                        p.print(getValueOf(employee,"CLASS_NAME"));
                        p.print("#");
                        p.print(getValueOf(employee,"MEMBER_TYPE"));
                        p.print("#");
                        p.print(getValueOf(employee,"PSWRD_EXP_PER"));
                        p.print("#");
                        p.print(getValueOf(employee,"DESCRIPTION"));
                        p.print("#@");
                        //p.close();
                        objid = getValueOf(employee,"OBJID");
                        classname = getValueOf(employee,"CLASS_NAME");
                        membertype = getValueOf(employee,"MEMBER_TYPE");
                        passwordexp = getValueOf(employee,"PSWRD_EXP_PER");
                        description = getValueOf(employee,"DESCRIPTION");
              catch(SAXException sxe)
                   Exception x = sxe;
                   if(sxe.getException() != null)
                        x = sxe.getException();
                   x.printStackTrace();
              catch(ParserConfigurationException pce)
                   pce.printStackTrace();
              catch(IOException ioe)
                   ioe.printStackTrace();
              catch(NullPointerException npe)
                   System.out.println(npe.getCause());
              table();
              buttonpanel = new JPanel();
              buttonpanel.setLayout(new FlowLayout());
              openbutton = new JButton("Open");
              donebutton = new JButton("Done");
              donebutton.setMnemonic('d');
              buttonpanel.add(openbutton);
              buttonpanel.add(donebutton);
              openbutton.addActionListener(this);
              donebutton.addActionListener(this);
              Container contentpane = getContentPane();
              frame.setContentPane(contentpane);
              contentpane.setLayout(new BorderLayout());
              contentpane.add(table.getTableHeader(),BorderLayout.PAGE_START);
              contentpane.add(table,BorderLayout.CENTER);
              contentpane.add(buttonpanel,BorderLayout.SOUTH);
              frame.setSize(500,400);
              frame.setVisible(true);
         static String getValueOf (Element element, String tagname)
              final NodeList children = element.getElementsByTagName(tagname);
              if (children.getLength() == 0) { return null; }
                   return concat(children, new StringBuffer()).toString();
         static StringBuffer concat (NodeList nodelist, StringBuffer buffer)
              for (int index = 0, length = nodelist.getLength(); index < length; index++)
                   final Node node = nodelist.item(index);
                   switch (node.getNodeType())
                        case Node.CDATA_SECTION_NODE: buffer.append(node.getNodeValue()); break;
                        case Node.ELEMENT_NODE: concat(node.getChildNodes(), buffer); break;
                        case Node.TEXT_NODE : buffer.append(node.getNodeValue()); break;
              return buffer;
         public void table()
              try
                   fis = new FileInputStream("QUERYResp.txt");
                   dis = new DataInputStream(fis);
                   finalstring = dis.readLine();
              catch(IOException e)
              st = new StringTokenizer(finalstring, "@");
              table = new JTable(st.countTokens() + 1,5);
              table.setValueAt("OBJID",0,0);
              table.setValueAt("CLASS NAME",0,1);
              table.setValueAt("MEMBER TYPE",0,2);
              table.setValueAt("PASSWORD DURATION",0,3);
              table.setValueAt("DESCRIPTION",0,4);
              int count = 0,cnt=0;
              StringTokenizer st1 = null;
              try
                   while(st.hasMoreTokens())
                        st1 = new StringTokenizer(st.nextToken(),"#");
                        cnt=0;
                        while(st1.hasMoreTokens())
                             table.setValueAt(st1.nextToken(),count,cnt++);
                        count++;
                        st1=null;
              catch(Exception e)
                   e.printStackTrace();
              //JTableHeader header = table.getTableHeader();
              table.setPreferredScrollableViewportSize(new Dimension(200,500));
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            if(ALLOW_ROW_SELECTION)
                 rowSM = table.getSelectionModel();
                 rowSM.addListSelectionListener(new ListSelectionListener(){
                            public void valueChanged(ListSelectionEvent e)
                                 ListSelectionModel row = (ListSelectionModel)e.getSource();
                                 if (row.isSelectionEmpty() == true)
                                    System.out.println("No rows are selected.");
                                else
                                     if (e.getValueIsAdjusting())
                                          return;
                                         int selectedRow = row.getMinSelectionIndex();
                                         System.out.println("Row " + selectedRow + " is now selected.");
                 JScrollPane scrollpane = new JScrollPane(table);
         public void createprivilegeclassdetails()
              PrivilegeClassDetails privilegeclassdetailsobj = new PrivilegeClassDetails();
              privilegeclassdetailsobj.frame.setSize(400,400);
              privilegeclassdetailsobj.frame.setVisible(true);
         public void actionPerformed(ActionEvent ae)
              String str = ae.getActionCommand();
              if(str.equalsIgnoreCase("done"))
                   System.out.println("SelectPrivilege Window Closed");
                   frame.dispose();
              if(str.equalsIgnoreCase("open"))
                   System.out.println("here");
                   createprivilegeclassdetails();
         public static void main(String a[])
              new SelectPrivilege();
    Copy the whole line if ur saving this in a file, as it is a string
    //QUERYResp.txt
    268435457#CSR#Employees#0#Customer Support Representative#@268435458#Hotline Engineer#Employees#0#Hotline Engineer#@268435459#Product Specialist#Employees#0#Product Specialist#@268435460#Senior Product Specialist#Employees#0#Senior Product Specialist#@268435461#Field Engineer#Employees#0#Field Engineer#@268435462#Support Manager I#Employees#0#Support Manager I#@268435463#Support Manager II#Employees#0#Support Manager II#@268435464#Development Engineer#Employees#0#Development Engineer#@268435465#Development Manager#Employees#0#Development Manager#@268435466#QA Engineer#Employees#0#QA Engineer#@268435467#QA Manager#Employees#0#QA Manager#@268435468#Technical Writer#Employees#0#Technical Writer#@268435469#Technical Publications Manager#Employees#0#Technical Publications Manager#@268435470#Site Configuration Manager#Employees#0#Site Configuration Manager#@268435471#Product Administrator#Employees#0#Product Administrator#@268435472#Technical Product Administrator#Employees#0#Technical Product Administrator#@268435473#Contract Specialist#Employees#0#Contract Specialist#@268435474#System Administrator#Employees#90#System Administrator#@268435475#Submitter#Contacts#0#Submitter#@268435476#Viewer#Contacts#0#Viewer#@268435477#Inventory Specialist#Employees#0#Inventory Specialist#@268435478#Logistics Manager#Employees#0#Logistics Manager#@268435479#Sales Representative#Employees#0#Sales Representative#@268435480#Marketing Representative#Employees#0#Marketing Representative#@268435481#Sales Manager#Employees#0#Sales Manager#@268435482#Offline User#Employees#0#Privilege Class for use with ClearEnterprise Traveler#@268435483#Call Center Agent#Employees#30#Call Center Agent#@268435484#Call Center Manager#Employees#0#Call Center Manager#@268435485#Customer Service Agent#Employees#0#Customer Service Agent#@268435486#Telemarketing Agent#Employees#0#Telemarketing Agent#@268435487#Telesales Agent#Employees#0#Telesales Agent#@268435488#Telesales Manager#Employees#0#Telesales Manager#@268435489#Avaya_Users#Employees#0#Privilege Class for Avaya. Only Clear Call Center Application Enabled.#@268435490#Account Manager#Employees#0#Account Manager for Accounts#@268435491#Account Executive#Employees#30#Account Executive for Accounts#@268435492#Pre Sales Tech Executive#Employees#0#Pre Sales Technical Executive#@268435493#Pre Sales Tech Team Lead#Employees#0#Pre Sales Technical Team Leader#@268435494#Post Sales Tech Executive#Employees#0#Post sales technical executive#@268435495#Post Sales Commercial Executive#Employees#0#Post sales commercial executive#@268435496#Vertical Domain Expert#Employees#0#Vertical Domain Expert#@268435497#Supervisor#Employees#0#Supervior who approves the billing adjustments#@268435498#RA#Employees#0##@268435499#Configuration#Employees#90#Privilege Class for Clarify Configurators#@268435500#FO Online Agent#Employees#0#Testing#@268435501#OTAF Remote Funcionality#Employees#0##@268435502#Sr.Manager CC#Employees#0#Customization for phase1 RUNS (1a).#@268435503#FO Online Unit - Agent #Employees#0#Customization for phase1 RUNS (1).#@268435504#FO Online - Agent (outbound)#Employees#0#Customization for phase1 RUNS (1b).#@268435505#Incoming mail unit manager#Employees#0#Customization for phase1 RUNS (2).#@268435506#Save team agent#Employees#0#Customization for phase1 RUNS (3).#@268435507#Save team supervisor#Employees#0#Customization for phase1 RUNS (4).#@268435508#Technical suport agent#Employees#0#Customization for phase1 RUNS (5).#@268435509#Technical suport supervisor#Employees#0#Customization for phase1 RUNS (6).#@268435510#Webstore Agents#Employees#0#Customization for phase1 RUNS (7).#@268435511#FO Offline Unit (Reg)- Supervisor#Employees#0#Customization for phase1 RUNS (8).#@268435512#Head C. Service (Circles)#Employees#0#Customization for phase1 RUNS (8a).#@268435513#Revenue Assurance#Employees#0#Customization for phase1 RUNS (9).#@268435514#Manager CC#Employees#0#Customization for phase1 RUNS (1a).#@268435515#FO Offline Unit - Agent at Contact Centre#Employees#0#Customization for phase1 RUNS (1).#@268435516#Telesales unit agent#Employees#0#Customization for phase1 RUNS (1).#@268435517#Incoming mail unit agent#Employees#0#Customization for phase1 RUNS (1).#@268435518#Telesales supervisor#Employees#0#Customization for phase1 RUNS (2).#@268435519#FO Online Unit - Supervisor#Employees#0#Customization for phase1 RUNS (2).#@268435520#FO Offline Unit (CC) - Supervisor#Employees#0#Customization for phase1 RUNS (2).#@268435521#TT unit agent#Employees#0#Customization for phase1 RUNS (5).#@268435522#TT unit supervisor#Employees#0#Customization for phase1 RUNS (6).#@268435523#Pos Agents#Employees#0#Customization for phase1 RUNS (7).#@268435524#FO Offline Unit - Regions#Employees#0#Customization for phase1 RUNS (7).#@268435525#Service fulfillment unit agent#Employees#0#Customization for phase1 RUNS (7).#@268435526#Sales Executives (Regions)#Employees#0#Customization for phase1 RUNS (7).#@268435527#Webstore Manager#Employees#0#Customization for phase1 RUNS (8).#@268435528#Service fulfillment unit manager#Employees#0#Customization for phase1 RUNS (8).#@268435529#Network#Employees#0#Customization for phase1 RUNS (9).#@268435530#After Sales#Employees#0#Customization for phase1 RUNS (9).#@268435531#Handsets#Employees#0#Customization for phase1 RUNS (9).#@268435532#Portal#Employees#0#Customization for phase1 RUNS (9).#@268435533#GIS#Employees#0#Customization for phase1 RUNS (9).#@268435534#Logistics#Employees#0#Customization for phase1 RUNS (9).#@268435535#Data Services#Employees#0#Customization for phase1 RUNS (9).#@268435536#Production Support#Employees#0#Since it is possible to temper the data form the Clarify GUI , restrict all access to users except for the minimal in order to control the env.#@268435537#Webstore Users#Employees#0##@268435539#IN_CSR#Employees#0#Privilege Class for Prepaid CSR's#@268435540#Configuration_Maha#Employees#0#Privilege Class for Clarify Configurators#@268435541#test privilege class#Employees#0##@268435542#PS_TEST#Employees#0##@268435543#TEST SACHIN#Employees#0#SACHIN TEST#@268435544#Supervisor1#Employees#300#Supervise and monitor agents#@268435545#Call Center Adminstrator#Employees#0#Call Center Admin Priv#@268435546#siva_test#Employees#0#new privilege class for test purpose#@268435547#PREPAID PCO#Employees#0#For PREPAID PCO#@268435548#santo_test#Employees#0#new privilage class for test#@

    Don't start by writing a 100 line program to test a component you don't know how to use. Start by writing a 10 line program. This is all you need:
              String[] columnNames = {"Date", "String", "Centered", "Integer", "Boolean"};
              Object[][] data =
                   {new Date(), "A", "A", new Integer(1), new Boolean(true)},
                   {new Date(), "B", "B", new Integer(2), new Boolean(false)},
                   {new Date(), "C", "C", new Integer(10), null},
                   {new Date(), "D", "D", new Integer(4), new Boolean(false)}
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              model.addTableModelListener( this );
              table = new JTable( model )
                   //  Returning the Class of each column will allow different
                   //  renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );

Maybe you are looking for

  • Work Center Utiliztion Report

    Dear Guruji In which tansaction code i can get report.It is compolsury to click on Capacity Durring Process order creation.i searching standard report Thanks Pankaj Kapadia

  • "Text on a path" and "paths" rasterised when printed from a PDF on an iGen

    I have just obtained from the printer the first proof of my book (printed on an iGen) and I'd like to find out where one of the problems lie. I'll ask the printer his opinion before second proof, but I don't like to annoy him unnecessarily. One of th

  • Item Status Cannot be Changed

    I  had an existing PO with an item on it that was flagged as not being an Inventory item by mistake. It appears the system allowed the creation of the PO while the item was flagged this way. A Goods Receipt PO was generated from the PO and all produc

  • File to BAPI error

    hi, iam getting following error in file to bapi scenario.plz help me 2007-11-02 17:21:20     Success     RFC adapter received a synchronous message. Attempting to send sRFC for BAPI_SALESORDER_CREATEFROMDAT1 2007-11-02 17:21:21     Error     Exceptio

  • Printing of purchase orders

    Hi. Actually I don't have a solution/ idea for the following issue. So I pass this overu2026 We just want to suppress the u201Cstandardu201D printing of purchase orders with a total value above a specific amount. A second message (EDI) should be proc