3 JComboBox in one panel

Hi,
I am using Java 1.3.1.
I have a panel in which i am putting 3 JComboBox objects(typically a date ie day,mth,yr)
the class implements ActionListener and in the actionPerformed i am tracking the events of tbese JComboBoxs'.However I want to indentify which combo box was cliked..ie was it day,mth,yr and accordingly write futher logic.
How can i find which JComboBox is changed?
Thanx a lot..it seems to be pretty simple..but somehow i am not able to get it..:(

Never mind getActionCommand, you aren't required to set one, or you could change it in your code somewhere and break your listener. Use getSource() to the the object that caused the event. Then use 'if' to see if that object is cb1, cb2, or cb3..
I'd make a small inner class for this panel that implements a listener, and add it to all 3 comboboxes.. Put the listeners on the comboboxes themselves, I wouldnt have the class implement a listener in this case..
if(ae.getActionCommand().equals("comboBoxChanged"))
JComboBox cb = (JComboBox)ae.getSource();

Similar Messages

  • How can I use the button in one panel to control the other panel's appearing and disappearing?

    How can I use the button in one panel to control the other panel's
    appearing and disappearing? What I want is when I push the button on
    one button . another panel appears to display something and when I
    push it again, that the second panel disappears.

    > How can I use the button in one panel to control the other panel's
    > appearing and disappearing? What I want is when I push the button on
    > one button . another panel appears to display something and when I
    > push it again, that the second panel disappears.
    >
    You want to use a combination of three features, a button on the panel,
    code to notice value changes using either polling in a state machine of
    some sort or an event structure, and a VI Server property node to set
    the Visible property of the VI being opened and closed.
    The button exists on the controlling panel. The code to notice value
    changes is probably on the controlling panel's diagram, and this diagram
    sets the Visible property node of a VI class property node to FALSE or
    TRUE to show or
    hide the panel. To get the VI reference to wire to the
    property node, you probably want to use the Open VI Reference node with
    the VI name.
    Greg McKaskle

  • Dreamweaver Panels - Only one panel visible at a time, others get obscured even with Always On Top.

    I have a problem with my Dreamweaver MX, and it is that I can only see one panel at a time, any other open panels get obscured. For example, with the work space maximized, and having the properties and behaviors panels open, I can only see one of the panels at the same time. If I click on any area of the work space each open panel will display and with the next click the other will display. If I make the work space smaller then the whole area of my screen, and move any open panels outside of the Dreamweaver work space, only then they will stay visible. I know this is not normal behavior, because I used to be able to see all the open panels simultaneously, with the work space maximized to use all the screen area. I went to Preferences> Panels> Always On Top, and all the checkmarks are still set, so as to keep all panels on top at all times, but this does no longer be the case. Can someone tell me what happened here, and how I can get back to being able to see all the open panels? BTW, I tried installing older version of Dreamweaver 4, and the same thing happens to both installed versions. This is extremely annoying!
    Thanks. -Al.

    Since I upgraded to Firefox 19 from 18.0.2, on my Windows XP (SP3) laptop, I, too, can no longer open a new window. File-->New Window does nothing; also can no longer tear off a tab and open it in a new window (it stays where it is). Also, if I right-click on a tab and select Move to New Window, nothing happens. All of these worked fine in FF 18.0.2. All of these work fine with FF 19 on Windows 7. Only an issue on my XP laptop.
    After trying to open a new window, and not seeing the new window come up (and yes, I waited a long time), I decided to close my current window, which had multiple tabs open. Instead of just closing, it pops up the message reminding me that I'm about to close all those tabs. If I say close, and then go into the Task Manager, the Firefox application has disappeared (as expected), but the firefox (and plug-in container) processes are still running. So I have to manually kill the Firefox process to get it to quit. it's as if it thinks there is another Window open (the one I tried to open but never appeared). This happens every single time! I've restarted my laptop, and that does not resolve the problem.
    Is there a way to downgrade back to v 18.0.2 until this is fixed?

  • Problem updating a control on one panel based on a value change in another control on a different panel

    Hi,
    I am trying to update the value of a control on one panel when the value of another control on a different panel is changed.  The two panels are saved in two different .uir files, so there are two associated .h files generated by CVI.  The problem is that, inside the callback function for the control that is being modified (Ctrl_Id_A on Panel_A), when I call SetCtrlVal(Panel_B, Ctrl_Id_B, Value); 'Panel_B' and 'Ctrl_Id_B' (which have the same numeric values as Panel_A = 1 and Ctrl_Id_A = 2 in their respective .h files) are being interpreted as Panel_A and Ctrl_Id_A.  I never understood how CVI makes this distinction, eg. knowing which of PANEL_A = 1 and PANEL_B = 1 is being referred to, but didn't worry about it since I never needed cross-communication between panels until now.  Any help on how to implement this would be greatly appreciated.  Thanks!
    Solved!
    Go to Solution.

    This is a basic issue on which you can find tons of forum posts
    The online help for the function recitates:
    int SetCtrlVal (int panelHandle, int controlID, ...);
    Parameters
    Input
    Name
    Type
    Description
    panelHandle
    int
    Specifier for a particular panel that is currently in memory. You obtain this
    handle from LoadPanel, NewPanel, or DuplicatePanel.
    controlID
    int
    The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
    value
    New value of the control. The data type of value must match the data type of the control.
    That is, you must not use the panel constant name in the first parameter of SetCtrlVal, use the panel handle instead. The system guarantees that all panel handles are unique throughout the whole application whichever is the number of panels used in every moment.
    int SetCtrlVal (int panelHandle, int controlID, ...);
    Purpose
    Sets the value of a control to a value you specify.
    When you call SetCtrlVal on a list box or a ring control, SetCtrlVal
    sets the current list item to the first item that has the value you
    specify. To set the current list item through a zero-based index, use SetCtrlIndex.
    When you call SetCtrlVal on a text box, SetCtrlVal appends value to the contents of the text box and scrolls the text box to display value. Use ResetTextBox to replace the contents of the text box with value.
    Note   This function updates the displayed value immediately. Use SetCtrlAttribute with ATTR_CTRL_VAL to set the control value without immediately updating the displayed value. For this reason, SetCtrlAttribute with ATTR_CTRL_VAL is generally faster than SetCtrlVal. However, if the control in which you are setting the value is the active control in the panel, SetCtrlAttribute with ATTR_CTRL_VAL displays the value immediately.
    Note   This function is not valid for graph and strip chart controls.
    Parameters
    Input
    Name
    Type
    Description
    panelHandle
    int
    Specifier for a particular panel that is currently in memory. You obtain this
    handle from LoadPanel, NewPanel, or DuplicatePanel.
    controlID
    int
    The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
    value
    New value of the control. The data type of value must match the data type of the control.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Functionality of JFormattedTextField and JComboBox in one control

    Hi,
    I am developing a component which shall switch from JFormattedField to JComboBox as per requirements. For example, If a single value is used then the component acts like a JFormattedTextField and if array of values is used then the component acts like a JComboBox.
    One way of doing this is to create a new class sub-classing JComponent, create both the above mentioned objects and then implement all the methods (inherited as well as sum of methods/properties of both the components) by forwarding the call to the JFormattedTextField or JCombobox or both.
    Can somebody suggest a better design.
    Thanks in advance! Good day!
    RKON

    almost2good wrote:
    How can I make Lion show a space number on the top of the screen so I can see which space I am in?
    Currently you cannot.
    almost2good wrote:
    How can I make Lion switch spaces in a ring? ie? 1, 2, 3, 4, 5, 6, 1, 2, 3,  ...
    You cannot organise Mission Control's "Desktops" this way. They are organised in a single row to allow the swipe gestures to work. Apple allows no way to customise this.
    almost2good wrote:
    How can I make lion switch directly to a numbered space?  ie: 1, 4, 5, 2, etc...
    By deafult you should be able toi switch by pressing ctrl plus the desktop number, e.g. ctrl+1. This is the same as Spaces in Snow Leopard. You can customise this under System Preferences (Keyboard > Keyboard Shortcuts > Mission Control).
    almost2good wrote:
    Without these three capabilities Mission Control is a giant step backward....I am disappointed in the way it works and would liketo know how to disable it and give me back the way spaces used to work.
    A lot of people are disapointed with Mission Control. In my opinion it's a step backwards from Spaces & Expose in Snow Leopard but peoples views on this will depend if they used Spaces & Expose in Leopard/Snow Leopard and the type of Mac they are using - it makes some sense on a Macbook Air, for example, with a small screen and multi-touch trackpad but not so much on an iMac or Mac Pro (sames goes for Launchpad). I just hope Apple listens to the criticism and enables customisation options to change the way Mission Control behaves.

  • Painting in only one panel?

    Hello,
    I need to make a joystick style gui part in my applet, but only in one panel of the applet, Is it possible to paint in just one panel, and if so, can you point me in the right direction? Or even better, is there a joystick style swing component i dont know about? it basically just needs to be a slider with x and y components. Also, Would using a custom synth look and feel screw up any painting im trying to do? Thanks beforehand.
    Cheers.

    Andre_Uhres wrote:
    I don't know about any "joystick style swing component" and I couldn't even tell you how to develop such a component.So I searched the web. This article might be helpful: [Virtual joystick GUI|http://www.freepatentsonline.com/6515687.html]. Logical Processing for the Virtual Joystick is summarized in the pseudo-code of TABLE 1.
    Edited by: Andre_Uhres on Jan 30, 2010 11:35 AM
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SimpleJoystickDemo extends JFrame {
        private int displayWidth = 340;
        private int displayHeight = 550;
        private final Point position;
        public SimpleJoystickDemo() {
            super("SimpleJoystickDemo");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(displayWidth, displayHeight);
            setLocationRelativeTo(null);
            position = new Point();
            SimpleJoystick myJoystick = new SimpleJoystick(150, position, 100);
            add(myJoystick, BorderLayout.PAGE_END);
            Drawing drawing = new Drawing(position);
            add(drawing);
        public static void main(final String[] args) {
            Runnable gui = new Runnable() {
                public void run() {
                    new SimpleJoystickDemo().setVisible(true);
            //GUI must start on EventDispatchThread:
            SwingUtilities.invokeLater(gui);
        class Drawing extends JPanel {
            private final Point position;
            public Drawing(Point position) {
                this.position = position;
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                Graphics2D g2 = (Graphics2D) g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON);
                g2.setColor(Color.RED);
                g2.fillOval(160 + position.x, 160 - position.y, 15, 15);
    class SimpleJoystick extends JPanel {
        //Maximum value for full horiz or vert position where centered is 0:
        private int joyOutputRange;
        private float joySize;     //joystick icon size
        private float joyWidth, joyHeight;
        private float joyCenterX, joyCenterY;  //Joystick displayed Center
        //Display positions for text feedback values:
        private int textHorizPos, textVertPos;
        private int fontSpace = 12;
        private float curJoyAngle;    //Current joystick angle
        private float curJoySize;     //Current joystick size
        private boolean isMouseTracking;
        private boolean leftMouseButton;
        private int mouseX, mouseY;
        private Stroke lineStroke = new BasicStroke(10,
                BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
        private final Point position;
        public SimpleJoystick(final int joyOutputRange, final Point position,
                final int joySize) {
            this.joyOutputRange = joyOutputRange;
            this.position = position;
            this.joySize = joySize;
            joyWidth = joySize;
            joyHeight = joyWidth;
            setPreferredSize(new Dimension((int) joyWidth + 250,
                    (int) joyHeight + 80));
            joyCenterX = getPreferredSize().width / 2;
            joyCenterY = getPreferredSize().height / 2;
            this.joySize = joyWidth / 2;
            setBackground(new Color(226, 226, 226));
            MouseAdapter mouseAdapter = new MouseAdapter() {
                @Override
                public void mouseMoved(final MouseEvent e) {
                    mouseCheck(e);
                @Override
                public void mousePressed(final MouseEvent e) {
                    leftMouseButton = SwingUtilities.isLeftMouseButton(e);
                    mouseCheck(e);
            addMouseMotionListener(mouseAdapter);
            addMouseListener(mouseAdapter);
        private void mouseCheck(final MouseEvent e) {
            mouseX = e.getX();
            mouseY = e.getY();
            float dx = mouseX - joyCenterX;
            float dy = mouseY - joyCenterY;
            if (leftMouseButton) {
                isMouseTracking = true;
            } else {
                isMouseTracking = false;
            if (isMouseTracking) {
                curJoyAngle = (float) Math.atan2(dy, dx);
                curJoySize = (float) Point.distance(mouseX, mouseY,
                        joyCenterX, joyCenterY);
            } else {
                curJoySize = 0;
            if (curJoySize > joySize) {
                curJoySize = joySize;
            position.x = (int) (joyOutputRange * (Math.cos(curJoyAngle)
                    * curJoySize) / joySize);
            position.y = (int) (joyOutputRange * (-(Math.sin(curJoyAngle)
                    * curJoySize) / joySize));
            SwingUtilities.getRoot(SimpleJoystick.this).repaint();
        @Override
        protected void paintComponent(final Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.LIGHT_GRAY);
            g2.fillOval((int) (joyCenterX - joyWidth / 2),
                    (int) (joyCenterY - joyHeight / 2),
                    (int) joyWidth, (int) joyHeight);
            //rotate and draw joystick line segment:
            Graphics2D g3 = (Graphics2D) g2.create();
            g3.translate(joyCenterX, joyCenterY);
            g3.rotate(curJoyAngle);
            g3.setColor(Color.GRAY);
            g3.setStroke(lineStroke);
            g3.drawLine(0, 0, (int) curJoySize, 0);
            g3.dispose();
            g2.setColor(Color.GRAY);
            g2.fillOval((int) joyCenterX - 10,
                    (int) joyCenterY - 10, 20, 20);
            textHorizPos = 50;
            textVertPos = (int) (joyCenterY - 50);
            g2.drawString("Horiz:", textHorizPos, textVertPos);
            textHorizPos += (4 * fontSpace);
            g2.drawString(String.valueOf((int) position.x), textHorizPos,
                    textVertPos);
            textHorizPos = 50;
            textVertPos += 12;
            g2.drawString("Vert:", textHorizPos, textVertPos);
            textHorizPos += (4 * fontSpace);
            g2.drawString(String.valueOf((int) position.y), textHorizPos,
                    textVertPos);
    }Edited by: Andre_Uhres on Feb 1, 2010 10:23 PM

  • Gridbaglayout over more than one panel

    hi
    i have a problem aligning my label / textfield combos.
    there are several rows where each contains a label and a textfield. my problem is that they are distributed over more than one panel.
    i have one gridbaglayout which manages my labels / textfields. what i want is that the labels are ALL the same width - it works fine for each panel but i cant bring that stuff to work that the widest label stands for ALL other labels.
    i hope you can imagine what my problem is. please help since i am kinda unsuspecting ;)
    thx

    Hey,
    Please download the application mentioned in it.
    When i have excuted the application i could find sort enabled for all the columns.
    wdContext.currentContextElement().getTableSorter().sort( wdEvent, wdContext.nodeTableSet() );
    Please check it..
    Jithin
    Edited by: jithin james on Apr 16, 2009 10:47 AM

  • How can I from one panel access elements on another panel ?

    I have a JFrame with 2 panels and a JMenu
    I am struggling to find a way how I can access JMenu from one of my panels ...
    Also how can I access elements on one panel from other panel ? At the moment I am passing a reference from one panel to other in the constructor but it's only one way communication now ... I can't go from second panel to first ...
    I am sure there must be an elegant way to solve this problem.
    Many thanks.
    Sergei

    OK I'll give you more details...
    I have a JFrame with multiple panels...
    Also I have a JMenu on JFrame...
    Now when user clicks a button on one of the panels I need to disable a menu item ... this is issue#1
    issue#2 is:
    how do I get two panels (they are separate classes) talking to each other ??? At the moment when I initialize a panel#2 from my Frame I pass to it reference to panel#1 and in this way panel#2 can talk to panel#1 but panel#1 can't talk to panel#2 ...
    I know there must be an elegant way to solve this problem... and I don't like having 2 classes tightly coupled like this... Can I use some kind of nice OO trick for this ? I was reading about custom listeners but I don't want to go crazy on this as I don't have time... actualy I've got only 1 day to solve this issue so any help will be greatly appreciated.
    Many thanks
    Sergei

  • Multiple panels on one panel

    i have three panels-mainPanel, panel1, panel2. my mainPanel has a borderlayout. i am trying to set both panels1 and 2 onto the center of the mainpanel. i only want to show one panel at a time until a button is clicked. i have used the setVisible command but i still get a panel with nothing on. is there a way around this. the following is my code. is there a way so i can have both panels in the center with all the components for each panels.
    public class IssueBook extends JFrame{
    private JFrame IssueBook;
    JFrame mainFrame = this;
    private JPanel mainPanel, panel1, panel2;
    public IssueBook() {
    IssueBook = new JFrame("Issue Or Return Book");
    mainPanel = new JPanel();
    panel1 = new JPanel();
    panel2 = new JPanel();
    mainPanel.setLayout(new BorderLayout());
    IssueBookPanel.setLayout(new FlowLayout());
    ReturnBookPanel.setLayout(new FlowLayout());
    mainPanel.add(IssueBookPanel, BorderLayout.CENTER);
    mainPanel.add(ReturnBookPanel, BorderLayout.CENTER);
    panel1.setVisible(true);
    panel2.setVisible(false);
    IssueBook.show( );
    }

    Layout managers and panels are one of those things that has to be studied, the good new is that for the most part it isn't difficult;-import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class TwoPanels extends JFrame implements ActionListener {
       JButton start = new JButton("Start");
       JButton submit1 = new JButton("<html><center><b>Add B<br>Remove A</center></html>");
       JButton submit2 = new JButton("<html><center><b>Add A<br>Remove B</center></html>");
       JPanel panel1, panel2, panel3, panel4;
       Container cont;
    public TwoPanels(){
       cont = getContentPane();
       cont.setLayout(new BorderLayout() );
       panel1 = new JPanel();
       panel1.setLayout(new FlowLayout());
       JLabel label1 = new JLabel("My application");
       panel1.add(label1);
       start.addActionListener(this);
       panel1.add(start);
       panel2 = new JPanel();
       panel2.setLayout(new FlowLayout());
       JLabel label = new JLabel("My starting panel");
       panel2.add(label);
       panel3 = new JPanel();
       panel3.setLayout(new FlowLayout());
       panel3.setBackground(Color.magenta);
       JLabel label2 = new JLabel("This is my pink panel, Panel A");
       label2.setForeground(Color.yellow);
       panel3.add(label2);
       submit1.addActionListener(this);
       panel3.add(submit1);
       panel4 = new JPanel();
       panel4.setLayout(new FlowLayout());
       panel4.setBackground(Color.blue);
       JLabel label3 = new JLabel("This is my placid panel, Panel B");
       label3.setForeground(Color.cyan);
       panel4.add(label3);
       submit2.addActionListener(this);
       panel4.add(submit2);
       cont.add("North", panel1);
       cont.add("Center", panel2);
       public void actionPerformed (ActionEvent e){
          if (e.getSource() == start){
             cont.remove(panel2);
             cont.add("Center", panel3);
             validate();
          if (e.getSource() == submit1){
             cont.remove(panel3);
             cont.add("Center", panel4);
             validate();
             repaint();
          if (e.getSource() == submit2){
             cont.remove(panel4);
             cont.add("Center", panel3);
             validate();
             repaint();
      public static void main(String[]args){
         TwoPanels m = new TwoPanels();
         m.setSize(240, 180);
         m.setLocation(150, 200);
         m.setDefaultCloseOperation( EXIT_ON_CLOSE );
         m.setVisible(true);
    }

  • How do I drag an image icon or image from one panel to another panel?

    Please help.
    I know to need how to drag an image icon from one panel to the other. For example, the first panel would shows the image files that is inside my folder. How can i code it so that I can drag the image that appear on the first panel into the second panel which will hold the images that I want to embed my barcode inside?
    The thumbnail size of the image and showing all the image files in my folder was done already, I only need to know how can I make the image icon to be able to drag from one panel to the other.
    Thanks.

    I found this code in some websites:
    public class ImageSelection extends TransferHandler {
         private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
         public int getSourceActions(JComponent c) {
              return TransferHandler.COPY;
         public boolean canImport(JComponent comp, DataFlavor flavor[]){
              if (!(comp instanceof JLabel)){
                   return false;
              for (int i=0, n=flavor.length; i<n; i++){
                   for (int j=0, m=flavors.length; j<m; j++){
                        if (flavor.equals(flavors[j])){
                             return true;
              return false;
         public Transferable createTransferable(JComponent comp) {
              if (comp instanceof JLabel) {
                   JLabel label = (JLabel)comp;
                   Icon icon = label.getIcon();
                   if (icon instanceof ImageIcon){
                        final Image image = ((ImageIcon)icon).getImage();
                        final JLabel source = label;
                        Transferable transferable = new Transferable(){
                             public Object getTransferData(DataFlavor flavor){
                                  if (isDataFlavorSupported(flavor)){
                                       return image;
                                  return null;
                             public DataFlavor[] getTransferDataFlavors(){
                                  return flavors;
                             public boolean isDataFlavorSupported(DataFlavor flavor){
                                  return flavor.equals(DataFlavor.imageFlavor);
                        return transferable;
              return null;
         public boolean importData(JComponent comp, Transferable t){
              if (comp instanceof JLabel){
                   JLabel label = (JLabel)comp;
                   if (t.isDataFlavorSupported(flavors[0])){
                        try {
                             Image image = (Image)t.getTransferData(flavors[0]);
                             ImageIcon icon = new ImageIcon(image);
                             label.setIcon(icon);
                             return true;
                        catch (UnsupportedFlavorException ignored){
                        catch (IOException ignored) {
              return false;
    What this codes does is to get the image from the imageicon and replace the image to the imageicon that you drag the source from. However, I had no clue how I can get the source's file name. Anyone can teach me how?
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to merge the Panel with another Panel to One Panel?

    As Title!!

    i will give it a shot. by no means do i say it is correct being a beginner myself
    Panel aPanel = new Panel();
    Panel anotherPanel = new Panel();
    Panel mythirdPanel = new Panel();
    aPanel.add(anotherPanel);
    aPanel.add(myThirdPanel);
    this should create one panel called aPanel with two panels inside - another Panel first, followed by mythirdPanel second. This should be in FlowLayout pattern as that is default unless specified.
    That is my guess and my shot.
    8)

  • Cannot re-group or rename one panel

    Got one panel named Tag with Attributes, Behaviours and
    Relvant CSS (DW
    MX2004). All options for this panel are unavailable (grayed
    out). I can't
    group Behaviours with any other panel, ditto for Relevant
    CSS, or even
    rename the panel. It's been like that from the start. I
    recently had DW
    re-create all preferences and settings for another reason and
    that didn't
    help this problem. All other panels are fine. This problem
    doesn't seem to
    exist on other computers. Is there a workaround for this? I
    really want to
    move the Behaviours to another panel and close that 'Tag'
    panel.
    Any suggestions?
    Marianne

    Went to Add/Remove programs, tried to uninstall quicktime, did not work. Got the 'Windows Installer' box stating "The feature you are trying to use is on a network resource that is not available" "Click OK to try again, or enter an alternate path to a folder containing the installation package 'QuickTime.msi' in the box below"
    Drop down on the bottom of the box gives 2 options
    C:\DOCUME~1\SCOTTA~1\LOCALS~1\Temp\IXP071.TMP\
    C:\Documents and Settings\All Users\Application Data\Apple Computer\Installer Cache\iTunes 7.0.2.16\
    If I click first option, I get 'Windows Installer" box stating: "The path C:\DOCUME~1\SCOTTA~1\LOCALS~1\Temp\IXP071.TMP\QuickTime.msi' cannot be found. Verify that you have access to this location and try again, or try to find the installation package 'QuickTime.msi' in a folder from which you can install the product QuickTime"
    If I click the second option, I get 'Windows Installer' box stating: "The path C:\Documents and Settings\All Users\Application Data\Apple Computer\Installer Cache\iTunes 7.0.2.16\QuickTime.msi' cannot be found. Verify that you have access to this location and try again, or try to find the installation package 'QuickTime.msi' in a folder from which you can install the product QuickTime"
    Any other options? Thanks in advance for your assistance.
    dell inspiron 2500   Windows XP  

  • How to access the JTextfield on one panel from the button on the other pane

    Hi to all!
    I m having very simple problem about getText() and setText(). I am developing the user interface for an application. I got the JTextField on one panel and one button on other panel. When I try to do getText() and SetText() operation on the JTextField which is placed on a JPanel with the help of JButton click event Which is placed on other panel. The JTextField doesn't response. My program is not showing any compilation as well as runtime error. So how can i solve this problem?
    Note: Duke dollar for rigth answer.
    Thanks! in advance!

    I've looked at the other post and was wondering what happened to all of those It is working briliantly...
    In any event, I've taken the original code and clean it up my way as shown below:
    import java.awt.event.*;
    public class MainClass {
       public static void main(String[] args) {
          MajorFrame majorFrame = new MajorFrame();
          majorFrame.setSize(550,550);
          majorFrame.show();
          majorFrame.addWindowListener(new WindowAdapter() {
             public void windowClosing(WindowEvent e) {
                System.exit(0);
       }  //method ends
    }  //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class MajorFrame extends JFrame implements ActionListener {
       Container contentPane = getContentPane();
       Panel1 panel1 = new Panel1();
       JButton buttonMajorFrame = new JButton("Button MajorFrame");
       public MajorFrame() {
          contentPane.setLayout(null);
          contentPane.setSize(550,550);
          panel1.setBounds(5,5,400,250);
          contentPane.add(panel1);
          buttonMajorFrame.setBounds(5,350,150,20);
          buttonMajorFrame.addActionListener(this);
          contentPane.add(buttonMajorFrame);
       } //constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == buttonMajorFrame) panel1.panel11.textField11.setText("majorFrame working");
       } //methode ends
    } //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel1 extends JPanel {
       Panel11 panel11;
       Panel12 panel12;
       public Panel1() {
          panel11 = new Panel11();
          panel12 = new Panel12(panel11);
          setLayout(null);
          panel11.setBounds(5,5,200,50);
          add(panel11);
          panel12.setBounds(5,65,200,50);
          add(panel12);
       //end constructor
    }//end classs
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel11 extends JPanel implements ActionListener {
       public JTextField textField11;
       JButton button11;
       public Panel11() {
          setLayout(null);
          textField11 = new JTextField();
          button11 = new JButton("Button 11");
          textField11.setBounds(5,5,120,20);
          add(textField11);
          button11.setBounds(5,25,120,20);
          button11.addActionListener(this);
          add(button11);
       } //constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == button11) textField11.setText("Text11 working");
       } //method ends
    } //class endss
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class Panel12 extends JPanel implements ActionListener {
       JButton button12 = new JButton("Button 12");
       public Panel11 panel11;
       public Panel12(Panel11 panel11) {
          this.panel11=panel11;
          setLayout(null);
          button12.setBounds(5,5,120,20);
          button12.addActionListener(this);
          add(button12);
       }//constructor ends
       public void actionPerformed(ActionEvent ev) {
          if (ev.getSource() == button12) panel11.textField11.setText("Text12 working");
       }//method ends
    }//class endssI think this is what you're looking for and hope it saves your rear end...hehehe!
    ;o)
    V.V.

  • Why 1: Type selected in yellow and 2: only one panel stays open?

    In Design CS4. G5 Mac. Final Tiger.
    1. I was setting some type to be force justified L/R. Several lines of centered type. Most of it, not all of it, became selected in solid yellow. I did not do the selecting. I could not find the answer in either of two ID reference books.
    I checked the Prefs several times, and the only thing I found that MIGHT relate to this is "Keeps." (Preferences > Composition > Keeps Violations/H&J Violations.) Though it says nothing about color choice nor about what it signifies. I know what pink signifies, but not what yellow does.
    2. Asked about this next problem before and was told about Workspaces and was told about grouping panels, neither answering the question as I recall. So let me try again.
    I have panel A open. It may be alone as Panel A or in a group with Panel B and maybe even with Panel C. Doesn't matter. But now I want to open Panel D. As soon as I click on Panel D, Panel A (alone or grouped) disappears. So my question is: Can I/how can I keep more than one panel open at the same time, grouped or single being 100% irrelevant? How can I keep Panel A and Panel D open at the same time as separate, not grouped, panels?
    I tried to ask clearly. My experience is it is most efficient (in Adobe Forums and in real life) to be clear about what you do want and equally clear about what you do not.  —Thank you.

    1. Yellow highlight is, I believe, substituted glyphs. Is the affected type all caps or samll caps, perchance, or non-default figures? You usually see this with ligatures, but small caps is pretty common, too.
    2. Do you have auto-collapse panels selected inthe prefs? This one would help to see a screen shot, I think. If the panels are docked, you must expand the dock to panel width or only one group (and a group can be one panel) will expand from the icon state at a time.

  • How many JComboBox in my panel?

    Hi,
    I'm writing a simple JPanel which contains three JComboBox, one for the day, one for the month and one for the year. It works fine and the constructor is the following:
    public class DatePanel extends JPanel implements ItemListener{
         * The combobox for the day.
        protected JComboBox comboDay = null;
         * The combobox for the month.
        protected JComboBox comboMonth = null;
         * The year.
        protected JComboBox comboYear = null;
         * A flag that indicates if the user has manually changed the date.
        protected boolean dateHasChanged = false;
         * Creates and set up each component of this panel.
        protected void setUpGUI(){
         // get the current date
         Calendar today = Calendar.getInstance();
         // create the components
         this.comboDay = new JComboBox();
         for(int i=1; i<=31; i++)
             this.comboDay.addItem(i);
         this.comboMonth = new JComboBox();
         for(int i=1; i<=12; i++)
             this.comboMonth.addItem(i);
         this.comboYear = new JComboBox();
         int currentYear = today.get(Calendar.YEAR);
         for( int i= (currentYear - 60); i< (currentYear + 5); i++)
             this.comboYear.addItem(i);
         // add the null values
         this.comboDay.addItem("--");
         this.comboMonth.addItem("--");
         this.comboYear.addItem("--");
         this.comboDay.setSelectedItem("--");
         this.comboMonth.setSelectedItem("--");
         this.comboYear.setSelectedItem("--");
         // add the listener
         this.comboDay.addItemListener(this);
         this.comboMonth.addItemListener(this);
         this.comboYear.addItemListener(this);
         // display components
         this.setLayout( new FlowLayout() );
         this.add(this.comboDay);
         this.add(this.comboMonth);
         this.add(this.comboYear);
         * Builds a panel without initializing it with a specific date.
        public DatePanel(){
         super();
         this.setUpGUI();
        }then I've got a subclass of the above panel which adds two comboes, one for the hour and one for minute. This is also working fine, and I've got a flag that says if the above three comboes should appear or not in the panel:
    public class TimePanel extends DatePanel {
         * The comboHour selection combo box.
        protected JComboBox comboHour = null;
         * The comboMinute selection combo box.
        protected JComboBox comboMinute = null;
         * Builds the time panel with the specific comboboxes.
         * @param alsoDates true if also the dates should be visibles
        public TimePanel(boolean alsoDates){
         super();
         this.setUpGUI();
         // shuld the dates be available?
         if( ! alsoDates ){
             this.comboDay.setEnabled(false);
             this.comboMonth.setEnabled(false);
             this.comboYear.setEnabled(false);
             this.remove(this.comboDay);
             this.remove(this.comboMonth);
             this.remove(this.comboYear);
         * Sets up the components.
        @Override
        protected void setUpGUI() {
         super.setUpGUI();
         // add the time components
         this.comboHour = new JComboBox();
         for( int i=0; i<24; i++ )
             this.comboHour.addItem(i);
         this.comboHour.addItemListener(this);
         this.comboMinute = new JComboBox();
         for(int i=0; i<60; i++)
             this.comboMinute.addItem(i);
         this.comboMinute.addItemListener(this);
         this.add(new JLabel("hh:"));
         this.add(this.comboHour);
         this.add(new JLabel("mm:"));
         this.add(this.comboMinute);
        }As you can see, when I pass false to the constructor of the TimePanel, the comboes of the date panel are removed from the layout of the panel itself, thus showing only the hour and minute ones.
    Now I was writing a JUnit test for this, and surprisingly when I run a code like the following:
         TimePanel tp1 = timePanel = new TimePanel(false);
         Component[] components = tp1.getComponents();
         int comboCount = 0;
         // count how many jcombobox there are, since it has been initialized
         // with the time only, it should contain only 2 combobox (hour and minutes)
         for(int i=0;i<components.length; i++ )
             if( components[i] instanceof JComboBox )
              comboCount ++;I found that the number of comboes on my panel are 7[, that is more than the max (5) when all the components are displayed. What is wrong here?
    Thanks,
    Luca

    I found that the problem seems to be in the setUpGui method, that is called from the parent constructor and from the child constructor, thus displaying 7 comboes. But if I remove the call from the child constructor then it seems as the parent comboes are uninitialized and thus I got a nullpointer exception.
    If I modify the constructor of the TimePanel into this:
       public TimePanel(boolean alsoDates){
         this.setUpGUI();
         // shuld the dates be available?
         if( ! alsoDates ){
             this.comboDay.setEnabled(false);
             this.comboMonth.setEnabled(false);
             this.comboYear.setEnabled(false);
             this.remove(this.comboDay);
             this.remove(this.comboMonth);
             this.remove(this.comboYear);
        }and explicity call the super.setupgui into the setupgui method
      protected void setUpGUI() {
         super.setUpGUI();
         // add the time components
         this.comboHour = new JComboBox();
         for( int i=0; i<24; i++ )
             this.comboHour.addItem(i);
         this.comboHour.addItemListener(this);
         this.comboMinute = new JComboBox();
         for(int i=0; i<60; i++)
             this.comboMinute.addItem(i);
         this.comboMinute.addItemListener(this);
         this.add(new JLabel("hh:"));
         this.add(this.comboHour);
         this.add(new JLabel("mm:"));
         this.add(this.comboMinute);
        }I got that the hour and minute comboes are added twice, and moreover the day,month and year are not removed. What is the right way to call the setupgui method to do what I'd like?
    Luca

Maybe you are looking for

  • MacBook Pro 17" Glossy (Late 2011) vs MacBook Pro 13" Glossy (Late 2011)

    Hi everybody, I have bought a MacBook Pro 17" 3 months ago. I really love it and it's cool. A few days ago, one of my friends came to my office, broght his MacBook Pro 13" which he had also bought it a few days after me. He told me he feels my MBP 17

  • Error message setting 'Location' property on a broken/orphaned track

    Hi, I'v written a tool in c# to repair broken links of tracks in iTunes. It worked fine with iTunes 9.x. But now, in iTunes 10.0.0.68, an exception error with a wrong error message ("Value does not fall within the expected range.") will be thrown, wh

  • Executable JAR using JDeveloper

    Hi, I created a very small Desktop Application using JDeveloper. What I want to do is to create an executable JAR file. I mean, is there any option in this tool like the one in Eclipse. Once executable JAR is created, I must be able to run it just by

  • Object []toArray()

    okay, i just frankly don't really know what this is , but i would like to make an object array from my linked list.I looked in the API documentastion, but i jsut didn't understatnd it. How would i write a method that would make an arry of the a linke

  • /etc/rc.sysinit mountpoint not found

    Whenever I boot I get errors about mount point not being found, the boot stops, and then something times out and it boots fine. It's still really anoyying waiting those 30 seconds. What can I do to fix it? Here's the errors and some general info. /et