Choice to JComboBox conversion

As part of converting my application from awt to swing, I am changing all Choice components to JComboBox. One problem I encountered is when you do an 'add' or 'remove' in JComboBox() it inturn fires an event that calls the itemStatechanged () function. This behaviour is different from the 'Choice' which doesn't fire an selection event on addition. Which affects the exisitng code/logic of the application
I thought of few solutions like implementing a jcombobob/combomodel wrapper to bypass the firing of the event. I was wondering if anyone has faced similar problem and had any kind of better solutions.
Thanks
RT

Using JDK1.4.1 and comboBox.addItem("new item"); didn't fire any event for me. I used an ActionListener and an ItemListener.

Similar Messages

  • Choice and JComboBox

    Hi all,
    Are there some methods like select(String arg0) and select(int arg0) of the java.awt.Choise for JcomboBox?
    sorry for my english!

    Yes, read the API. I think the methods you want start with "setSelected...".

  • Quicktime conversion taking too long

    this is my first time using final cut pro.
    for my class, i've created a video that is 7 minutes long using mpeg-4 clips with AAC audio. they're pretty small clips, 320X240, and fully rendered.
    we're supposed to present our projects next week to the class and so today i tried exporting the video i created using Quicktime conversion, but the status bar told me it would take 40 minutes to fully convert, and it only kept going up from there.
    what am i doing wrong? under movie settings window that pops up, i clicked on default settings, but changed compression to h.264 (cus everywhere i've read has said it's faster), changed the dimensions to match 320X340, and changed the audio format to AAC with a 128 bit rate.
    is this correct? i know i probably shouldn't have used mpeg-4 files to edit, but i hadn't known that until i read it here, today. i've also read that since i'm using mpeg-4 files, i shouldn't have tried exporting it as a h.264 file. is that true? could that have been the reason why the conversion was taking so long?
    your help/advice is very much appreciated.
    Message was edited by: ec84
    Message was edited by: ec84

    let's put it this way. if you do File>Export>Quicktime you'll make a quicktime file with the same compressor as your sequence and it'll render faster. If you select File>Export>Quicktime Conversion you can make a quicktime file with a compression of your choice. (although the conversion process takes time). so you could compress it into a DVCPRO 50 quicktime, or an uncompressed quickime or H.264 quicktime. any of these settings will play in quicktime. These you can select through the options button in the converter window. we just suggest you use Export>Quicktime because it's faster easier and it's useless in your situation to convert.

  • DLL Wrapper works when functions called out of main(), not from elsewhere?

    Hello all,
    I am currently trying the JSAsio wrapper out ( http://sourceforge.net/projects/jsasio )
    Support on this project is nearly unexisting and a lot of people seem to complain that it doesn't work well.
    It works very nicely here, I wrote a few test classes which called some functions (like playing a sound or recording it) and had no problems whatsoever.
    These test classes were all static functions and ran straight out of the main() method and printed some results to the console.
         public static void main(String[] args)
              boolean result = callFunction();
              .. end..
         public static boolean callFunction()
              initASIO();
              openASIOLine();
              return true;
         }The results were all great!
    Then I tried to implement these test classes into my swing-based applications. So I want to call these same functions, as in the test classes, as a result of any user action (for example, selecting the asio driver in a combobox) But then these asio driver functions just stop to work. I get errors saying that the ASIO driver is not available. (meaning that the dll wrapper loads the wrong asio driver or can't load one at all)
    The library path and classpath are all set correctly, exactly the same as the test classes. Even copied the test code word for word in to my swing applications but it still will not work. I am calling these functions in a new Thread, and even put them in a static methods to try and get that working. When calling these asio methods from the main() method AFTER I set up my components gives me the desired results as well. But as soon as I call these same methods (which are in the same class) from a swing event, it fails;
    public class ASIOTest
         public static void main(String[] args)
              ASIOTest test = new ASIOTest();
              test.callFunction(); // <-- WORKS
         public ASIOTest()
              initializeComponents();
         private void initializeComponents()
              frame = new JFrame();
              choices = new JComboBox();
              choices.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event)
                     // user made selection
                    new Thread(
                            new Runnable() {
                                public void run() {
                                    try
                                         callFunction(); // <-- DOES NOT WORK
                                    catch (Exception e)
                                        e.printStackTrace();
                            }).start();
         public void callFunction()
              initASIO();
              openASIOLine();
    }Is there something fundamental I am missing here?
    For what reasons can an application which uses JNI functions go wrong when working in a swing enviroment? (and out of a static context, although this does not seem to make any difference, eg. when calling these functions from static methods inside another class, inside a new thread when the user has generated an event)
    I am hoping someone could point me in the right direction :-)
    Thank you in advance,
    Steven
    Edited by: dekoffie on Apr 21, 2009 11:11 AM
    Edited by: dekoffie on Apr 21, 2009 11:16 AM

    jschell wrote:
    Two applications.
    And you probably run them two different ways.
    The environment is different so one works and the other doesn't.Thank you for your fast reply!
    Well, I am running the "updated" version from the same environment; I copied the jframe, and a jcombobox into my original test class which only ran in the java console. Consider my second code example in my original post as the "updated" version of the first code example. And as I pointed out, it works fine when I call the jni functions in the main method, but not when I call it from inside the ActionListener.
    Or am I again missing something essential by what you mean with a different environment? The classpath and the working directory is exactly the same, as is the Djava.library.path option. :-)
    Thanks again!

  • What to do when Adobe's indifference is "destroying" your business?  Where to contact when normal Adobe support don't help?

    I have tried to get help 2 weeks using Adobe customer service. I have chatted with supervisors and normal staff “million times” and only one time I have talked with normal phone support. Phone support promised follow up the case and call me back next day between 9-10 am but nobody called. Many times chat support have swear that someone from phone support will call me back but I haven’t get any call. Every time chat support just apologize and say that we understand that you are frustrated. Every time chat support says that someone will get back to me by email / phone asap. No emails or calls as they have promised.  I have got 2 times email and emails including something which not help anything, when I contact again to the chat support they just apologize and say that someone get back to me again. But nobody get. Last 3 days they have said that I have to just wait, my case has transferred to the upper level. But same time they promised that someone from upper level will contact me urgently… they will call me and send email. No calls/no emails. Yesterday supervisor from normal chat support promised that someone will call me night time because this is only time when “upper level team” is working. But again… last night I did not get any call. Nobody sent even email.
    Now my question: What I can do if normal support don't help... case is transferred to the upper level but I don't get any feedback from there– can I call somewhere, can I email somewhere? I can’t just wait. My product is expiring next Tuesday, Adobe Creative Cloud last update deleted all files and folder from my computer and changed my storage size to be 2GB, it was before 71GB… and I can’t renew my CC subscription because on my account has some “error”, it’s not accept my credit card payments.
    I already had to cancel my yesterday meetings because did not have presentations to show, all gone. For one meeting I went without presentation and try to explain something, you know what happened.
    Next week is most important week in company history and now we try to do here all presentations from the beginning because Adobe don’t give any helps! This Adobe’s indifference might cost for us millions. Case is not easy to explain shortly but main question is… can I call somewhere? I am living in Thailand. Normal phone support / chat support not work in this case.
    Or is the only choice post all conversations in social media and let everyone know how Adobe works. Maybe people start to share my posts and Adobe starts to get very negative publicity and maybe someone will contact me then. I have unbelievable comments etc. from the customer service, if I will post it Adobe / support looks really foolish.
    Note: don’t never trust that your files are safe in Adobe Cloud. If you don’t take safe copies every minute you might be dead. Everyone who is using Illustrator and use linked file know also that most of links not work when you copy files to the other location, if your Illustrator file includes 100 pictures, maybe you have to link all again and this takes time. And if you have 100 files which all have 100 links...

    Unfortunately, not an answer... but wanted to chime in that I could have written this! Because I have had the exact same experiences over and over and over with Adobe. "Indifference" is definitely the right term. Been promised so many times that someone will call me back and no one EVER does. I've had maybe 2 very good phone support experiences out of maybe 20 awful ones. Phone tells you to go to chat... chat tells you to go to forums... and forums have never once answered my questions even when they told me they would have an expert review my post and answer it. I have so much wasted time invested with Adobe. Now, my account is cancelled due to non payment. My fault, been a rough couple of months. Well, there was no obvious place to post payment to "continue" my subscription. So I get on chat, and they send me a link to the payment portal. I enter my info and I get "Sorry, we're experiencing technical issues. Please check back soon." I tell chat this and they tell me to check back later, that all their tools are down. I asked when, and of course they don't know. Always the same. This was just tonight. 2 hours later.. still can't pay my account.
    I've written to management with direct contact info to a particular manager. Never heard a word back. I dream of the day when someone launches a design suite like adobe's or better... but also with awesome customer support. I will be so gone Adobe.. and won't ever look back.. won't miss you in the least.
    I was also a victim of the big Adobe hack a while back and my info was compromised. Think anyone offered me even a month free? Pshaw... right!

  • At a dead end.  A java student in need of help.

    I've hit a wall.
    The program is supposed to allow the user to draw five different polygons using the polygon class and let the user pick the color for each polygon and move each polygon around the screen once it is filled in. The user clicks to add the points and then double clicks to fill in the polygon. Then the polygon is added to the array. Up to the dragging around the screen the program works fine. When I click on a polygon with the shift down nothing happens and I've spent several hours trying to figure out why.
    I've placed several System.out.println's in the code and I think I've narrowed down the problem. (I hope) I think it might have something to do with the canvas repainting. Because the S.O.P's show that the program is going through and executing that code. It might also have something to the do with my polygon array, but to my knowledge that is setup fine.
    Thanks a bunch if you try to help.
    Brad
    // Full Code Below
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class poly extends JFrame implements ActionListener
         /* Accessible Variables */
         private JPanel canvas;
         private JPanel mp;
         private JComboBox choice;
         private JButton reset;
         private Podly polyArray[] = new Podly[5];
         private Podly currentPoly = new Podly();
         private Podly movingPoly = new Podly();
         private int count;
         private Color currentColor;
         private Point firstPoint;
         private boolean newPoly = true;
         private boolean moving = false;
         private boolean overflowed = false;
         poly()
              setTitle("Polygon");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              count = 0;
              /* Interactive Buttons and Menus */
              JMenuBar tp = new JMenuBar();
              JMenu color = new JMenu("Color");
              JMenuItem MBlack = new JMenuItem("Black");
              color.add(MBlack);
              JMenuItem MRed = new JMenuItem("Red");
              color.add(MRed);
              JMenuItem MGreen = new JMenuItem("Green");
              color.add(MGreen);
              JMenuItem MYellow = new JMenuItem("Yellow");
              color.add(MYellow);
              MBlack.addActionListener(this);
              MRed.addActionListener(this);
              MGreen.addActionListener(this);
              MYellow.addActionListener(this);
              tp.add(color);
              canvas = new CanvasArt();
              canvas.setBackground(Color.white);
              canvas.addMouseListener(new Points());
              canvas.addMouseMotionListener(new Moved());
              choice = new JComboBox();
              choice.addItem("Black");
              choice.addItem("Red");
              choice.addItem("Green");
              choice.addItem("Yellow");
              choice.addActionListener(this);
              reset = new JButton("Reset");
              reset.addActionListener(this);
              JLabel chooseColor = new JLabel("Choose a color:");
              JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
              mp = new JPanel();
              mp.add(chooseColor);
              mp.add(choice);
              mp.add(reset);
              mp.add(holdShift);
              setJMenuBar(tp);
              getContentPane().add(canvas);
              getContentPane().add(mp, "South");          
         public static void main(String [] args)
              JFrame main = new poly();
              main.setSize(600, 600);
              main.setVisible(true);
         public void actionPerformed(ActionEvent e)
              Object test = e.getSource();
              Object selection;
              if (test instanceof JComboBox)
                   JComboBox source = (JComboBox)e.getSource();
                   selection = source.getSelectedItem();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
              else if (test instanceof JButton) // Repaints if Reset Button is Pressed
                   repaint();
                   currentPoly.reset();
                   count = 0;
                   overflowed = false;
              else
                   JMenuItem source = (JMenuItem)e.getSource();
                   selection = source.getText();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
         class Podly extends Polygon // Class adds Color Fuctionality to Polygon class
              Color polyColor;
              void setColor(Color y)
              {polyColor = y;}
              Color getColor()
              {return polyColor;}
         /* Canvas Painting Panel */
         class CanvasArt extends JPanel
              public void paintComponent(Graphics g)
                   super.paintComponent(g);
                   System.out.println("Canvas is called");
                   System.out.println(polyArray);
                   for (int i=0; i>count;i++)
                        System.out.println("Loop is going");
                        Podly y = polyArray;
                        g.setColor(y.getColor());
                        g.fillPolygon(y);
                        System.out.println(y);
                        System.out.println("Loop has filled in polygon"); // Test
                   System.out.println("painting complete");
         class Points extends MouseAdapter
              public void mousePressed(MouseEvent e)
                   Graphics g = canvas.getGraphics();
                   if (overflowed) // Checks for overflow in program.
                        g.setColor(Color.RED);
                        Font font = new Font("SansSerif",Font.BOLD, 30);
                        g.setFont(font);
                        g.drawString("OVERFLOW", 10, 30);
                        Font font2 = new Font("SansSerif",Font.BOLD, 20);
                        g.setFont(font2);
                        g.setColor(Color.BLUE);
                        g.drawString("Double Click to Play Again", 10, 50);
                        if (e.getClickCount() == 2) // Allows user to play again.
                             repaint();
                             currentPoly.reset();
                             count = 0;
                             overflowed = false;
                   else
                        int x = e.getX();
                        int y = e.getY();
                        if (newPoly)
                             firstPoint = new Point(x,y);
                             if (e.isShiftDown())
                                  System.out.println("Gets before Check loop");
                                  for (int r=count-1;r>=0;r--)
                                       System.out.println("Inside For Check Loop");
                                       System.out.println(polyArray[r]);
                                       if (!polyArray[r].contains(x,y))          
                                            System.out.println("Point is found");
                                            movingPoly = polyArray[r];
                                            System.out.println("MovingPoly Defined");
                                            moving = true;
                                            System.out.println("Moving is true"); // test
                                            break;
                             else
                                  currentPoly.setColor(currentColor);
                                  currentPoly.addPoint(x,y);
                                  g.fillOval(x,y,1,1);
                                  newPoly = false;
                        else
                             if (e.getClickCount() == 2)
                                  g.setColor(currentPoly.getColor());
                                  g.fillPolygon(currentPoly);
                                  polyArray[count] = currentPoly;
                                  currentPoly.reset();
                                  count++;
                                  if (count == polyArray.length)
                                  {overflowed = true;}
                                  newPoly = true;
                             else
                                  g.setColor(currentPoly.getColor());
                                  currentPoly.addPoint(x,y);
                                  g.drawLine(firstPoint.x, firstPoint.y, x, y);
                                  firstPoint.move(x,y);
              public void mouseReleased(MouseEvent e)
                   if(e.isShiftDown())
                   { moving = false; }
         class Moved extends MouseMotionAdapter
              public void mouseDragged(MouseEvent e)
                   if (moving && e.isShiftDown())
                        int x = e.getX();
                        int y = e.getY();
                        System.out.println("Gets here");
                        movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                        firstPoint.move(x,y);
                        canvas.repaint();

    Here is the updated code still with the color error I talked about above.
    :) Thanks for all the help everyone.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class poly extends JFrame implements ActionListener
         /* Accessible Variables */
         private JPanel canvas;
         private JPanel mp;
         private JComboBox choice;
         Podly [] polyArray;
         private Podly currentPoly;
         private Podly movingPoly;
         private int count;
         private Color currentColor;
         private Point firstPoint;
         private Color polyColor;
         private boolean newPoly = true;
         private boolean moving = false;
         private boolean overflowed = false;
         poly()
              setTitle("Polygon");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  // Exits program on window close.
              polyArray = new Podly[5];
              count = 0;                                      // Set count to zero.
              /* Interactive Buttons and Menus */
              JMenuBar tp = new JMenuBar();
              JMenu color = new JMenu("Color");
              JMenuItem MBlack = new JMenuItem("Black");
              color.add(MBlack);
              JMenuItem MRed = new JMenuItem("Red");
              color.add(MRed);
              JMenuItem MGreen = new JMenuItem("Green");
              color.add(MGreen);
              JMenuItem MYellow = new JMenuItem("Yellow");
              color.add(MYellow);
              MBlack.addActionListener(this);
              MRed.addActionListener(this);
              MGreen.addActionListener(this);
              MYellow.addActionListener(this);
              tp.add(color);
              canvas = new CanvasArt();
              canvas.setBackground(Color.white);
              canvas.addMouseListener(new Points());
              canvas.addMouseMotionListener(new Moved());
              choice = new JComboBox();
              choice.addItem("Black");
              choice.addItem("Red");
              choice.addItem("Green");
              choice.addItem("Yellow");
              choice.addActionListener(this);
              JLabel chooseColor = new JLabel("Choose a color:");
              JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
              mp = new JPanel();
              mp.add(chooseColor);
              mp.add(choice);
              mp.add(holdShift);
              setJMenuBar(tp);
              getContentPane().add(canvas);
              getContentPane().add(mp, "South");          
         /* Button Listeners */
         public void actionPerformed(ActionEvent e)
              Object test = e.getSource();
              Object selection;
              if (test instanceof JComboBox)
                   JComboBox source = (JComboBox)e.getSource();
                   selection = source.getSelectedItem();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
              else
                   JMenuItem source = (JMenuItem)e.getSource();
                   selection = source.getText();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
         class Podly extends Polygon  // Class adds Color Fuctionality to Polygon class
              void setColor(Color y)  // sets the Polygon's color.
              {polyColor = y;}
              Color getColor()   // returns the Polygon's color.
              {return polyColor;}
         /* Canvas Painting Panel */
         class CanvasArt extends JPanel
              public void paintComponent(Graphics g)
                   super.paintComponent(g);
                        for (int i=0; i<count;i++)
                             g.setColor(polyArray.getColor());
                             g.fillPolygon(polyArray[i]);
         class Points extends MouseAdapter
              /* Listens for mouse press, constructs polygons, stores them in array. */
              public void mousePressed(MouseEvent e)
                   Graphics g = canvas.getGraphics();
                   if (overflowed) // Checks for overflow in program.
                        g.setColor(Color.RED);
                        Font font = new Font("SansSerif",Font.BOLD, 30);
                        g.setFont(font);
                        g.drawString("OVERFLOW", 10, 30);
                        Font font2 = new Font("SansSerif",Font.BOLD, 20);
                        g.setFont(font2);
                        g.setColor(Color.BLUE);
                        g.drawString("Double Click to Play Again", 10, 50);
                        if (e.getClickCount() == 2) // allows user to play again by resetting.
                             repaint();
                             count = 0;
                             overflowed = false;
                   else
                        int x = e.getX();
                        int y = e.getY();
                        if (newPoly)
                             firstPoint = new Point(x,y);
                             if (e.isShiftDown())
                                  for (int r=count-1;r>=0;r--)
                                       if (polyArray[r].contains(x,y))          
                                            movingPoly = polyArray[r];
                                            moving = true;
                                            break; // exits for loop after Polygon with point is found.
                             else
                                  currentPoly = new Podly();
                                  currentPoly.addPoint(x,y); // Adds the first point.
                                  currentPoly.setColor(currentColor); // Sets the Polygon Color
                                  g.fillOval(x,y,1,1);
                                  newPoly = false;
                        else
                             /* Close the current Polygon at double click,
                             * then moves on to the next. */
                             if (e.getClickCount() == 2)
                                  g.setColor(currentPoly.getColor());
                                  g.fillPolygon(currentPoly);
                                  polyArray[count] = currentPoly;
                                  count++;
                                  if (count == polyArray.length)
                                  {overflowed = true; canvas.repaint();}
                                  newPoly = true;
                             else
                                  g.setColor(currentPoly.getColor());
                                  currentPoly.addPoint(x,y);
                                  g.drawLine(firstPoint.x, firstPoint.y, x, y);
                                  firstPoint.move(x,y);
              /* Listens for mouse release */
              public void mouseReleased(MouseEvent e)
                   if(e.isShiftDown())
                   { moving = false; }
         /* Moves selected Polygon around */
         class Moved extends MouseMotionAdapter
              public void mouseDragged(MouseEvent e)
                   if (moving && e.isShiftDown())
                        int x = e.getX();
                        int y = e.getY();
                        movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                        firstPoint.move(x,y);
                        canvas.repaint();
         public static void main(String [] args)
              JFrame poly = new poly();
              poly.setSize(600, 600);
              poly.setVisible(true);

  • How to integrate Flex with Word Documents

    Now I am doing R & D about Flex and MS-Office integration (.doc, .dox, .odt, .ods, .xls, .xlsx).
    While surfing the internet some people said there is no way to display & edit document in flex applications. But some people suggested to use third party tools.
    I got print2flash as a third party tool which is helpful to convert word file to .swf file but it not working some times. So I couldnt get any idea regarding this. Kindly help to me to fix this.

    I would try a couple of things and see what works the best. If you need to show an exact document replica than going with PDF or HTML format should be your first choice. The conversion would be done on the server and the only solution to come up with is how to show documents. In order to show either format you will have to stick to an AIR application. If it has to be a web application than you can try opening a word doc over the network as a file (doing it from an html wrapper), or loading it from your web and allowing the Browser showing it via a default document viewer. In both situations a document will be open in a new browser window. If that's not an option, go back to AIR.
    HTH

  • Getting Text to show on GUI

    I'm about desperate because i spent 3 days on this and i'm am in dire need for help!
    1. First i want to create a GUI that it a quiz.
    2. Create Questions by using Combo Box
    3. Next it creates a text field and allow me to input my answer
    4. following that, after the input is inputted, i click a button that says check answer and it will return if it is correct or false.
    The problem is that code is so messed up that i don't know where to go.
    When i run it, it show me a combo box with 3 questions but before i even answer it, it shows that i'm incorrect.
    Thats why I can't really brief wat i need help in. So, could you write a quick code that can summarize the whole thing. You can use my code and fix it up. Thanks very so much!
    package anaquiz;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult = new JLabel("");
    public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(20); //step 4
            Listener listen = new Listener();
            choice.addActionListener(listen);
            setLayout(new BoxLayout(this, 0));
            add(choice);
            add(label);
            add(text);
            add(testresult);
    private class Listener implements ActionListener {
    public void actionPerformed(ActionEvent event ) {
       int c = choice.getSelectedIndex();
         switch (c) {
                 case 0:
                    label.setText("Whats the famous tennis brand that begins with 'W'?");
                    if (Answer1.equals(input))testresult.setText("Correct");
                  else { testresult.setText("Incorrect");
                     break;
                 case 1:
                    label.setText("What do you call when someone misses a serve?");
                    if (Answer2.equals(input))testresult.setText("Correct");
                   else { testresult.setText("Incorrect");
                    break;
                 case 2:
                    label.setText("Should you shake hands after a match?");
                    if (input.equals(Answer3))testresult.setText("Correct");
                     else{
                         testresult.setText("Incorrect");
                    break;
          testresult.setVisible(false);
    public static void main(String[] args)    {
            JFrame frame = new JFrame("Quiz");
            frame.getContentPane().add(new AnAQuiz());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
          //  frame.show();
            frame.setVisible(true);
    }

    package anaquiz;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult = new JLabel("");
        public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(20); //step 4
            ButtonListener listen = new ButtonListener();
            CheckBoxListener listen1 = new CheckBoxListener();
            choice.addActionListener(listen);
            choice.addActionListener(listen1);
            setLayout(new BoxLayout(this, 0));
            add(choice);
            add(label);
            add(text);
            testresult.setVisible(false);
            add(testresult);
        private class  CheckBoxListener implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                int c = choice.getSelectedIndex();
                switch (c) {
                case 0:
                    label.setText(
                            "Whats the famous tennis brand that begins with 'W'?");
                    break;
                case 1:
                    label.setText("What do you call when someone misses a serve?");
                    break;
                case 2:
                    label.setText("Should you shake hands after a match?");
                    break;
            private class  ButtonListener implements ActionListener {
                public void actionPerformed(ActionEvent event) {
                    int c = choice.getSelectedIndex();
                    if (Answer1.equals(input)) testresult.setText("Correct");
                    else
                        testresult.setText("Incorrect");
                    if (Answer2.equals(input)) testresult.setText("Correct");
                    else
                        testresult.setText("Incorrect");
                    if (input.equals(Answer3)) testresult.setText("Correct");
                    else
                        testresult.setText("Incorrect");
            public static void main(String[] args) {
                JFrame frame = new JFrame("Quiz");
                frame.getContentPane().add(new AnAQuiz());
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
                //  frame.show();
                frame.setVisible(true);
    }now it has no errors but correct and incorrect doesn't show after i type in the answer in the textfield after hitting the enter button

  • Quicktime page loads taking too long

    I've got a page I'm building with 10 short mp3 clips. Here's a sample of the code for each clip:
    <object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" codebase=
    "http://www.apple.com/qtactivex/qtplugin.cab"
    width="49" height="16">
    <param name="src" value="http://www.mysite.com/test/mp3/lookoflove.mp3">
    <param name="autoplay" value="false">
    <param name="controller" value="true">
    </object>
    Is there a parameter I can add that would keep the page from preloading all of the files and make it so the file wouldn't actually load until the 'play' button was pressed? The files are all around 600-700kb each which, by themselves don't take too long but all together make the page a little too long to wait for.

    let's put it this way. if you do File>Export>Quicktime you'll make a quicktime file with the same compressor as your sequence and it'll render faster. If you select File>Export>Quicktime Conversion you can make a quicktime file with a compression of your choice. (although the conversion process takes time). so you could compress it into a DVCPRO 50 quicktime, or an uncompressed quickime or H.264 quicktime. any of these settings will play in quicktime. These you can select through the options button in the converter window. we just suggest you use Export>Quicktime because it's faster easier and it's useless in your situation to convert.

  • Getting Correct and Incorrect to show on my GUI

    What am i missing to allow correct and incorrect to show on my GUI.
    package anaquiz;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult;
        public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(42); //step 4
            Listener listen = new Listener();
            choice.addActionListener(listen);
            add(choice);
            add(label);
            add(text);
        private class Listener implements ActionListener {
            public void actionPerformed(ActionEvent event ) {
            int c = choice.getSelectedIndex();
                switch (c) {
                case 0:
                    label.setText("Whats the famous tennis brand that begins with 'W'?");
                    if (input.equals(Answer1))testresult = new JLabel("Correct!"); //Having difficulty getting the correct and the incorrect to show as a label
                     else testresult = new JLabel("Incorrect!");
                     break;
                 case 1:
                    label.setText("What do you call when someone misses a serve?");
                    break;
                 case 2:
                    label.setText("Should you shake hands after a match?");
                    break;
        public static void main(String[] args)
            JFrame frame = new JFrame("Quiz");
             frame.getContentPane().add(new AnAQuiz());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.show();

    Basically adding in the code tjacobs01 demo'd for you and a little extra.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private int chosen;
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult = new JLabel("");
        public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(42); //step 4
            Listener listen = new Listener();
            choice.addActionListener(listen);
            setLayout(new BoxLayout(this, 0));
            add(choice);
            add(label);
            add(text);
              text.addKeyListener(new KeyAdapter() {
              public void keyPressed(KeyEvent ke) {
                if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
                  input = text.getText();
                  if ( chosen == 0  &&  input.equals(Answer1) )
                    label.setText("Correct");
                  else if ( chosen == 1  &&  input.equals(Answer2) )
                    label.setText("Correct");
                  else if ( chosen == 2  &&  input.equals(Answer3) )
                    label.setText("Correct");
                  else
                    label.setText("Incorrect");
            add(testresult);
            testresult.setVisible(false);
        private class Listener implements ActionListener {
            public void actionPerformed(ActionEvent event ) {
            chosen = choice.getSelectedIndex();
            testresult.setVisible(true);
                switch (chosen) {
                case 0:
                    label.setText("Whats the famous tennis brand that begins with 'W'?");
                    break;
                 case 1:
                    label.setText("What do you call when someone misses a serve?");
                    break;
                 case 2:
                    label.setText("Should you shake hands after a match?");
                    break;
                 default:
                    break;
                text.requestFocus();
        public static void main(String[] args)
            JFrame frame = new JFrame("Quiz");
            frame.getContentPane().add(new AnAQuiz());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
    }

  • Hyperlink issues in Converted Project

    I've just recently upgraded to RoboHELP Version 8 to get a better results on the the full text search in WebHelp (the output of our choice). The conversion appeared to go great and I've been happily working away on new content.
    As our developer is still changing screen names etc in the development cycle of a new product, I have been using variables for all screen names so that I only need to change the value in one place when they come up with yet another U-beaut name for the screen. Quite often I would also insert a hyperlink over the variable to another topic.
    Unfortunately, when I had to revisit one of my existing topics I've found that any hyperlink that has been inserted on top of a variable in a table or drop-down seems to have been lost. This means that nearly 75% of my hyperlinking has gone west!
    Has anyone else experienced problems in this area?  I did try searching to problems with Version 8 which brought to light a couple of other little issues that I'll keep an eye on but couldn't see any queries about variables and hyperlinks.
    Regards from sunny Brisbane (Queensland, Australia).

    Hi Kathy
    Indeed sometimes working with variables can seem pesky!
    My initial thought pattern upon reading your issue was that RoboHelp 8 supports formatted variables. This means that your variable may contain a hyperlink. w00t!! Then I had a big ole Homer Simpson style D'OH! moment and smacked myself on the forehead as it occurred to me that if you did that, it would certainly work and preserve the hyperlink but ALL instances of the variable would share the same link destination. And that's likely not the case, eh?
    I just tested this action with my version 8 and found that RoboHelp HTML seemed to work fine to place a hyperlink over a variable. I closed the topic and reopened and it left things intact. I closed the project and reopened and it left things intact.
    Naturally this causes questions to be begged:
    How exactly are you creating the links?
    How exactly are you testing to see that the links are failing?
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Convert to PDF - Word Styles - Hidden Text

    I have a Word 2003 document with a table of contents (TOC) which is the user guide for my software application.  Using Acrobat Pro 8 I would like to create a PDF which has bookmarks at the same pages as the TOC entries.  The only appropriate choice for the conversion is to use Word styles, as there aren't any headings or bookmarks in the Word document.  I do not need any additional text in the document, so my intent was to attach styles to the TC fields in the Word document.  It appears that the converter only sees styles attached to standard, visible text in the document.  Attaching styles to the TC fields, hidden text, or the the header text for a section yields noPDF bookmarks.  Letting Acrobat look for the TOC styles points all of the bookmarks to the TOC where a user would have to click again to go to the content.
    Any suggestions would be appreciated.

    Thanks for your reply.
    I have been through the conversion settings and created some test documents that were much smaller than my user guide.
    What I have found is that if I assign a style to this: Starting the program¶
    It will get picked up as a bookmark, unless the text is formatted as hidden.
    If I assign a style to this: {·TC·"Starting the program"·}¶
    It will not get picked up as a bookmark.
    It doesn't work if I duplicate the text and they are part of the same paragraph with the style is applied to the text outside of the field braces:
    {·TC·"Starting the program"·}Starting the program¶
    The example above will work if the entire paragraph is formatted with the style.
    It would seem that the best solution would be for the converter to recognize the TC fields and their level switches as bookmark sources.

  • Connecting view button to player! help

    hi! I have posted my codes for Client and ClientChoice.
    in the actionlistener event of the ClientChoice(gui) have i have called the Client class where the player is found and where connection is made to the server. the error i get is that the .class of the Client is:
    mainCl(java.lang.String[]) in Client cannot be applied to (java.lang.String,java.lang.String)          cl.mainCl(a,b);
    can anyone help me ! am i doing the right thing or someway else plz help me......i have a week on that and i'm being late. here are the code:
    //Client.java
    //package ana;
    import java.io.*;
    import java.awt.*;
    import java.net.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.media.*;
    import javax.media.rtp.*;
    import javax.media.rtp.event.*;
    import javax.media.rtp.rtcp.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.format.AudioFormat;
    import javax.media.format.VideoFormat;
    import javax.media.Format;
    import javax.media.format.FormatChangeEvent;
    import javax.media.control.BufferControl;
    * Client to receive RTP transmission using the RTPConnector.
    public class Client implements ReceiveStreamListener, SessionListener,
         ControllerListener
    String sessions[] = null;
    RTPManager mgrs[] = null;
    Vector playerWindows = null;
    boolean dataReceived = false;
    Object dataSync = new Object();
    public Client(String sessions[]) {
         this.sessions = sessions;
    public Client(String a, String b)
         }//constructor
    protected boolean initialize() {
    try {
         mgrs = new RTPManager[sessions.length];
         playerWindows = new Vector();
         SessionLabel session;
         // Open the RTP sessions.
         for (int i = 0; i < sessions.length; i++) {
              // Parse the session addresses.
              try {
              session = new SessionLabel(sessions);
              } catch (IllegalArgumentException e) {
              System.err.println("Failed to parse the session address given: " + sessions[i]);
              return false;
              System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
              mgrs[i] = (RTPManager) RTPManager.newInstance();
              mgrs[i].addSessionListener(this);
              mgrs[i].addReceiveStreamListener(this);
              // Initialize the RTPManager with the RTPSocketAdapter
              mgrs[i].initialize(new RTPSocketAdapter(
                             InetAddress.getByName(session.addr),
                             session.port, session.ttl));
              // You can try out some other buffer size to see
              // if you can get better smoothness.
              BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
              if (bc != null)
              bc.setBufferLength(350);
    } catch (Exception e){
    System.err.println("Cannot create the RTP Session: " + e.getMessage());
    return false;
         // Wait for data to arrive before moving on.
         long then = System.currentTimeMillis();
         long waitingPeriod = 30000; // wait for a maximum of 30 secs.
         try{
         synchronized (dataSync) {
              while (!dataReceived &&
                   System.currentTimeMillis() - then < waitingPeriod) {
              if (!dataReceived)
                   System.err.println(" - Waiting for RTP data to arrive...");
              dataSync.wait(1000);
         } catch (Exception e) {}
         if (!dataReceived) {
         System.err.println("No RTP data was received.");
         close();
         return false;
    return true;
    public boolean isDone() {
         return playerWindows.size() == 0;
    * Close the players and the session managers.
    protected void close() {
         for (int i = 0; i < playerWindows.size(); i++) {
         try {
              ((PlayerWindow)playerWindows.elementAt(i)).close();
         } catch (Exception e) {}
         playerWindows.removeAllElements();
         // close the RTP session.
         for (int i = 0; i < mgrs.length; i++) {
         if (mgrs[i] != null) {
    mgrs[i].removeTargets( "Closing session from AVReceive3");
    mgrs[i].dispose();
              mgrs[i] = null;
    PlayerWindow find(Player p) {
         for (int i = 0; i < playerWindows.size(); i++) {
         PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
         if (pw.player == p)
              return pw;
         return null;
    PlayerWindow find(ReceiveStream strm) {
         for (int i = 0; i < playerWindows.size(); i++) {
         PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
         if (pw.stream == strm)
              return pw;
         return null;
    * SessionListener.
    public synchronized void update(SessionEvent evt) {
         if (evt instanceof NewParticipantEvent) {
         Participant p = ((NewParticipantEvent)evt).getParticipant();
         System.err.println(" - A new participant had just joined: " + p.getCNAME());
    * ReceiveStreamListener
    public synchronized void update( ReceiveStreamEvent evt) {
         RTPManager mgr = (RTPManager)evt.getSource();
         Participant participant = evt.getParticipant();     // could be null.
         ReceiveStream stream = evt.getReceiveStream(); // could be null.
         if (evt instanceof RemotePayloadChangeEvent) {
         System.err.println(" - Received an RTP PayloadChangeEvent.");
         System.err.println("Sorry, cannot handle payload change.");
         System.exit(0);
         else if (evt instanceof NewReceiveStreamEvent) {
         try {
              stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
              DataSource ds = stream.getDataSource();
              // Find out the formats.
              RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
              if (ctl != null){
              System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
              } else
              System.err.println(" - Recevied new RTP stream");
              if (participant == null)
              System.err.println(" The sender of this stream had yet to be identified.");
              else {
              System.err.println(" The stream comes from: " + participant.getCNAME());
              // create a player by passing datasource to the Media Manager
              Player p = javax.media.Manager.createPlayer(ds);
              if (p == null)
              return;
              p.addControllerListener(this);
              p.realize();
              PlayerWindow pw = new PlayerWindow(p, stream);
              playerWindows.addElement(pw);
              // Notify intialize() that a new stream had arrived.
              synchronized (dataSync) {
              dataReceived = true;
              dataSync.notifyAll();
         } catch (Exception e) {
              System.err.println("NewReceiveStreamEvent exception " + e.getMessage());
              return;
         else if (evt instanceof StreamMappedEvent) {
         if (stream != null && stream.getDataSource() != null) {
              DataSource ds = stream.getDataSource();
              // Find out the formats.
              RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
              System.err.println(" - The previously unidentified stream ");
              if (ctl != null)
              System.err.println(" " + ctl.getFormat());
              System.err.println(" had now been identified as sent by: " + participant.getCNAME());
         else if (evt instanceof ByeEvent) {
         System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
         PlayerWindow pw = find(stream);
         if (pw != null) {
              pw.close();
              playerWindows.removeElement(pw);
    * ControllerListener for the Players.
    public synchronized void controllerUpdate(ControllerEvent ce) {
         Player p = (Player)ce.getSourceController();
         if (p == null)
         return;
         // Get this when the internal players are realized.
         if (ce instanceof RealizeCompleteEvent) {
         PlayerWindow pw = find(p);
         if (pw == null) {
              // Some strange happened.
              System.err.println("Internal error!");
              System.exit(-1);
         pw.initialize();
         pw.setVisible(true);
         p.start();
         if (ce instanceof ControllerErrorEvent) {
         p.removeControllerListener(this);
         PlayerWindow pw = find(p);
         if (pw != null) {
              pw.close();
              playerWindows.removeElement(pw);
              //p.close(); //i added to know if player close when click
         System.err.println("Client internal error: " + ce);
    * A utility class to parse the session addresses.
    class SessionLabel {
         public String addr = null;
         public int port;
         public int ttl = 1;
         SessionLabel(String session) throws IllegalArgumentException {
         int off;
         String portStr = null, ttlStr = null;
         if (session != null && session.length() > 0) {
              while (session.length() > 1 && session.charAt(0) == '/')
              session = session.substring(1);
              // Now see if there's a addr specified.
              off = session.indexOf('/');
              if (off == -1) {
              if (!session.equals(""))
                   addr = session;
              } else {
              addr = session.substring(0, off);
              session = session.substring(off + 1);
              // Now see if there's a port specified
              off = session.indexOf('/');
              if (off == -1) {
                   if (!session.equals(""))
                   portStr = session;
              } else {
                   portStr = session.substring(0, off);
                   session = session.substring(off + 1);
                   // Now see if there's a ttl specified
                   off = session.indexOf('/');
                   if (off == -1) {
                   if (!session.equals(""))
                        ttlStr = session;
                   } else {
                   ttlStr = session.substring(0, off);
         if (addr == null)
              throw new IllegalArgumentException();
         if (portStr != null) {
              try {
              Integer integer = Integer.valueOf(portStr);
              if (integer != null)
                   port = integer.intValue();
              } catch (Throwable t) {
              throw new IllegalArgumentException();
         } else
              throw new IllegalArgumentException();
         if (ttlStr != null) {
              try {
              Integer integer = Integer.valueOf(ttlStr);
              if (integer != null)
                   ttl = integer.intValue();
              } catch (Throwable t) {
              throw new IllegalArgumentException();
    * GUI classes for the Player.
    class PlayerWindow extends Frame {
         Player player;
         ReceiveStream stream;
         PlayerWindow(Player p, ReceiveStream strm) {
         player = p;
         stream = strm;
         public void initialize() {
         add(new PlayerPanel(player));
         public void close() {
         player.close();
         setVisible(false);
         dispose();
         public void addNotify() {
         super.addNotify();
         pack();
    * GUI classes for the Player.
    class PlayerPanel extends Panel {
         Component vc, cc;
         PlayerPanel(Player p) {
         setLayout(new BorderLayout());
         if ((vc = p.getVisualComponent()) != null)
              add("Center", vc);
         if ((cc = p.getControlPanelComponent()) != null)
              add("South", cc);
         public Dimension getPreferredSize() {
         int w = 0, h = 0;
         if (vc != null) {
              Dimension size = vc.getPreferredSize();
              w = size.width;
              h = size.height;
         if (cc != null) {
              Dimension size = cc.getPreferredSize();
              if (w == 0)
              w = size.width;
              h += size.height;
         if (w < 160)
              w = 160;
         return new Dimension(w, h);
    public static void mainCl(String argv[])
         if (argv.length == 0)
         prUsage();
         Client avReceive = new Client(argv);
         if (!avReceive.initialize()) {
         System.err.println("Failed to initialize the sessions.");
         System.exit(-1);
         // Check to see if Client is done.
         try {
         while (!avReceive.isDone())
              Thread.sleep(1000);
         } catch (Exception e) {}
         System.err.println("Exiting Client");
    static void prUsage() {
         System.err.println("Usage: Client <session> <session> ...");
         System.err.println(" <session>: <address>/<port>/<ttl>");
         System.exit(0);
    }// end of Client
    //package ana;
    import javax.swing.*;
    import javax.swing.UIManager;
    import java.awt.*;
    import java.awt.event.*;
    public class ClientChoice
         public static void main(String args[])
              try
                             UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                        catch(Exception e)
         }//main
         JFrame frame=new JFrame("--- New Line Movie ---");
         //Create the menu bar
         JMenuBar menuBar;
         JMenu menu;
         menuBar = new JMenuBar();
         //Build the file menu in the menu bar
         menu = new JMenu("File");
         menu.setMnemonic(KeyEvent.VK_F);
         menuBar.add(menu);
         JMenuItem menuItem= new JMenuItem("Exit",KeyEvent.VK_X);
         menuItem.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent e)
                        System.exit(0);
         menu.add(menuItem);
         //Build help menu in the menu bar.
         menu = new JMenu("Help");
         menu.setMnemonic(KeyEvent.VK_H);
         menuBar.add(menu);
         JMenuItem help_item=new JMenuItem("Help Topics",KeyEvent.VK_T);
         menu.add(help_item);
         JMenuItem about_item=new JMenuItem("About Us");
         menu.add(about_item);
         frame.setJMenuBar(menuBar);
              ImageIcon icon=new ImageIcon("images/potter.jpg","");
              JButton clickmovie=new JButton(icon);
              //final JLabel latest=new JLabel("<html><caption>Harry Potter</caption></html>");
              //clickmovie.add(latest);
              final JLabel welcome1=new JLabel("<html><font color=blue face=arial size=3><strong>New Line Movie</strong> gives you the possibility to view your favorite movies.<br>You can choose your category of movies below and click on any movie to get more information about it. <br>Latest News about new movies are also available. ENJOY!!!</font></html>");
              frame.getContentPane().add(welcome1,BorderLayout.EAST);
              final JLabel copyright=new JLabel("<html><font color=blue face=arial size=3><p align=center>&copy Copyright 2004</p></font></html>");
              //frame.getContentPane().add(copyright,BorderLayout.EAST);
              JPanel actionPanel=new JPanel();
              JPanel cartoonPanel=new JPanel();
              JPanel comedyPanel=new JPanel();
              JPanel fictionPanel=new JPanel();
              JPanel mainPanel=new JPanel();
              mainPanel.setLayout(new GridLayout(2,1,5,5));
              mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
              mainPanel.add(actionPanel);
              mainPanel.add(cartoonPanel);
              mainPanel.add(comedyPanel);
              mainPanel.add(fictionPanel);
              //mainPanel.add(copyright);
              actionPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Action"),BorderFactory.createEmptyBorder(5,5,5,5)));
              cartoonPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Cartoon"),BorderFactory.createEmptyBorder(5,5,5,5)));
              comedyPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Comedy"),BorderFactory.createEmptyBorder(5,5,5,5)));
              fictionPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Science Fiction"),BorderFactory.createEmptyBorder(5,5,5,5)));
              frame.getContentPane().add(mainPanel,BorderLayout.SOUTH);
              frame.getContentPane().add(clickmovie,BorderLayout.WEST);
              // Create combo box with action movies choices
              final JComboBox actionChoices;
              String[] actionmovie={"-Select a movie-","X-Men","Spiderman"};
              actionChoices=new JComboBox(actionmovie);
              actionChoices.setSelectedIndex(0);
              actionPanel.add(actionChoices);
              actionChoices.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        JComboBox cb = (JComboBox)e.getSource();
                        String act = (String)cb.getSelectedItem();
                        if(act=="X-Men")
                             JFrame action_xmen= new JFrame("--- New Line Movie: X-Men --- ");
                   action_xmen.setSize(400,350);
                   JPanel main=new JPanel();
                   main.setLayout(new GridLayout(2,1,5,5));
                             main.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
                             ImageIcon icon_men=new ImageIcon("images/x-men.jpg","");
                   JButton clickmovie_men=new JButton(icon_men);
                   final JLabel xmen_overview=new JLabel("<html><font color=blue face=arial size=3><b>Title:</b></font> <font color=black><strong>X-Men 2 </strong></font> <br><br><font color=blue face=arial size=3><b>Starring:</b> Hugh JACKMAN and Halle BARRY<br><br><b>Story:</b> The time has come for those who are different to stand united. <br><br>A military officer with a link to Wolverine's mysterious past conspires <br><br>to eradicate the mutant population for once and all. In order to defeat <br><br>this new menace, the X-men will be forced to join forces with Magneto. <br><br><b>Duration:</b> 1hr45min </font></html>");
                   final JLabel copyright=new JLabel("<html><font color=blue face=arial size=3><p align=center>&copy Copyright 2004</p></font></html>");
                             action_xmen.getContentPane().add(copyright,BorderLayout.SOUTH);
                   JButton view=new JButton("View");
                   view.setLayout(new BoxLayout(view,BoxLayout.X_AXIS));
                                            view.add(Box.createHorizontalGlue());
                             view.add(Box.createRigidArea(new Dimension(30,0)));
                   view.setMinimumSize(new Dimension(20,100));
                   view.setPreferredSize(new Dimension(20,100));
                   view.setMaximumSize(new Dimension(Short.MAX_VALUE,Short.MAX_VALUE));
                   view.setMnemonic('v');
                   view.addActionListener(new ActionListener()
                                  public void actionPerformed(ActionEvent e)
                                            String a="172.22.45.44/42050";
                                            String b="172.22.45.44/42052";
                                            String argv=a+b;
                                            Client cl= new Client(a,b);
                                            cl.mainCl(a,b);
                                            //this is the code i added so that on clicking the view button
                                            //the client is automatically connected to the server and the player
                                            //plays on the current machine
                   main.add(clickmovie_men);
                             main.add(view);
                             //action_xmen.getContentPane().add(view,BorderLayout.SOUTH);
                   action_xmen.getContentPane().add(main,BorderLayout.WEST);
                   action_xmen.getContentPane().add(xmen_overview,BorderLayout.EAST);
                   action_xmen.show();
                        else if(act=="Spiderman")
                             JFrame action_spider= new JFrame("--- New Line Movie: Spiderman --- ");
                             action_spider.setSize(400,350);
                   action_spider.show();
              //Create combo box with cartoon movies choices
              JComboBox cartoonChoices=null;
              String[] cartoonmovie={"-Select a movie-","Le Roi Lion"};
              cartoonChoices=new JComboBox(cartoonmovie);
              cartoonChoices.setSelectedIndex(0);
              cartoonPanel.add(cartoonChoices);
              //cartoonChoices.addActionListener();
              //Create combo box with comedy movies choices
              JComboBox comedyChoices=null;
              String[] comedymovie={"-Select a movie-"};
              comedyChoices=new JComboBox(comedymovie);
              comedyChoices.setSelectedIndex(0);
              comedyPanel.add(comedyChoices);
              //comedyChoices.addActionListener();
              //Create combo box with fiction movies choices
              JComboBox fictionChoices=null;
              String[] fictionmovie={"-Select a movie-","ET"};
              fictionChoices=new JComboBox(fictionmovie);
              fictionChoices.setSelectedIndex(0);
              fictionPanel.add(fictionChoices);
              //fictionChoices.addActionListener();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
    //Implement player function here
    }//end of ClientChoice

    You are passing two String objects to a method that accepts an String array.
    try this to get rid of one error.
    Client cl = new Client(a, b);
    String[] c = {a,b};
    Client.mainCl(c);

  • Converting music!!

    Hi all,
    I want to convert all my WMA files to iTunes friendly files (preferably MP3), and be able to play the converted files in windows media player on my laptop, as well as transfer them to my ipod classic.
    I have converted some as "MP3 Encoder" selected in the preferences tab, but I chose to open them with media player and it says "The selected file has a file extension (.m4a) that is not recognized.
    How can I convert WMA files to iTunes friendly files, and be able to play them through windows media player?
    I have a choice in the conversion list of:
    AAC
    AIFF
    Apple Lossless Encoder
    MP3 Encoder
    WAV Encoder
    Can anyone help?! Thanks!

    Mclaren 697,
    If you are going to use both iTunes and WMP, the most flexible choice will be MP3. Go to Edit > Preferences > Advanced > Importing and set the preference to "MP3 Encoder." Pick your bit rate; if you don't know what to use, use 192.
    Take one WMA file and add it to your iTunes library, and watch what happens. Assuming it is an unprotected WMA, iTunes will create an MP3 and add it to the iTunes library. Verify that the new MP3 plays in both iTunes and WMP. Then delete the original WMA.
    Once you understand how it works, do the other thousands of your WMAs.
    Let us know if there are any problems with this. If by any chance your WMAs are protected and don't convert, also let us know.

  • Optimal Settings for Converting Sony AVCHD .MTS Footage for DVD Delivery

    I am starting with footage from a Sony HDR-SR7 camcorder. Since iMovie is still kind of wonky with this, I am going to batch convert all my clips using the VeggieTools plug-in scripting for *Sony Vegas Pro* (under my Windows partition of my MacBook Pro). I can convert over each file into a new clip in a lot of different formats.
    My goal is to *bring the footage over to Mac and edit it in Final Cut Express.* Eventually, I will be mastering and delivering on DVD (most likely through iDVD). And I am looking for guidance.
    First, I have a lot of choices for the conversion format. But I am not sure what to use. I know that the original is upper field dominant and HD in size (16:9). I will eventually be going to standard DVD NTSC (with letterboxing top and bottom to fill up the format space of the 4:3 aspect ratio). And I assume that is lower field dominant.
    Do I need to find some setting that lets me convert the footage to double the 29.97 fps rate while interpolating the fields? Or do I not have to worry about this? I am worried that bringing the size of the footage down will create some weird artifacts if this isn't taken care of first.
    I guess the main question is, since I am looking to pretty much just edit these clips together and won't be doing much in the way of special effects, what's the best way or format to choose to *turn the HD footage into high quality SD footage* that I can quickly trim and string together *in Final Cut Express*...
    Not sure if I gave enough info. I will be checking often in anyone wishes to try and tackle this one and needs more details...
    And thanks for listening!!

    OK my fault for not being clear on an extremely important point: I don't need anamorphic widescreen. Sorry to waste your brainpower on my lack of clarity. Mea culpa.
    I intend to show this only on a standard definition TV from a standard definition DVD player. The "letterboxing" I spoke of is intentional on my part inside the standard def 4:3 frame. I will just let there be black bars at the top and the bottom.
    So I don't need full super high resolution during this transfer (IF iMovie hadn't stopped recognizing my Sony AVCHD MTS camera after the first batch of video I collected, this wouldn't even be an issue. Been spending days on the forums trying all the solutions for the rest of my footage...).
    But now that I have a workaround, I am just mostly confused about what to do about the field order (and thus, the frame rate) and the resizing (for convenience in size and playback speed). The original is upper first, and I am pretty sure that the QuickTime Movie I eventually make for iDVD should be lower field first (haven't tried tackling the can of worms of ideal MOV settings for an iDVD standard def disc yet).

Maybe you are looking for

  • What is difference between MBEWH & MCHBH table?

    hi guru's what is difference between MBEWH & MCHBH table? wat ever stock in these table are different? i am doing support already i have two reports one is for Stock at PLANT level and one BATCH level . they used table for quantity MBEWH for PLANT le

  • My photosmart C7250 all-in-one used to allow me to print black and white only, now it won't

    My photosmart c7250 all-in-one used to allow me to print in black and white only if I changed properties to print in grayscale, black and white only.  Now it says it won't print until I replace one of the empty color cartridges.  I do no understand w

  • Need help getting itunes!!!!!

    i am having problems with my itunes, i have recently deleted it for warning of a trogen virus on my computer, of course all is fine now, but the new version of itunes will not finish it's installation program for Apple Software Update 'cannot be remo

  • No Audio in AirPlay mirroring from my mac (OS-ML) to Apple TV

    I get a picture but no audio. I saw this discussion: No Audio when Airplay Mirroring from Mac to Apple TV BUT in my case I can't change the sound settings to AirPlay. When I click it with the cursor, it tosses me back to Internal Speakers, and won't

  • Purchased apps won't appear in iTunes, even though they are in my account

    Hi. I switched to Windows 7 (clean install), installed iTunes and my purchased iTunes apps won't show up, neither in the library nor in the left hand column where you can sync with the ipod (touch). And yet the programs do appear on the list of purch