Know how many JPanel has been selected

Hi, i had somethings to do, and i really dont figure how to do it, i have an applet that is a kind of paint, and each draw is done on a new JPanel so is there a way to know which JPanel the user has select if i want to be able to select more than one JPanel. Dont know if you understand, my english isnt so good... Could be like a selection tool but i want to know which JPanel has been selected between x,y and width,height of a rectangle made with the mouse....
thx for the help

i could go with a getComponentAt to know which one has been under the selected rectangle, but dont know how can i move it all after i know which one has been selected with the mouse

Similar Messages

  • How to know how many carts have been ordered as "bought on behalf of"

    I'm looking for a way to know how many carts have been order in the past six months as "bought on behalf of" I've looked at tables CRMD_PARTNER and BUT000 but, I'm not sure how to determine what are the key fields and the SAP queries that I'll need to obtain such count. Any help will be appreciated. Thanks,

    I'm in Classic scenario which means that the PO and other relevant documents are stored in ECC. A programmer here helped me to obtain the information that I was looking for by querying the PO header and PO items tables (EKKO, EKPO) for those orders where the requestor and the bought on behalf of persons where different (ERNAM, AFNAM):
    SELECT DISTINCT EKKO~EBELN EKKO~ERNAM EKPO~AFNAM
    FROM EKKO
    INNER JOIN EKPO ON EKKO~EBELN = EKPO~EBELN
    WHERE EKKO~BSART = 'EC'
    AND EKKO~ERNAM <> EKPO~AFNAM
    AND EKKO~AEDAT > '20110101'
    Thanks All for your help,
    Oscar.

  • How do I know how many JFrames has opened ?

    Hi,
    I've got an application which has a main form (JFrame).
    Inside this main form there are buttons which opens others JFrames.
    When I close the main form I need to show how many others Jframes has opened.
    How do I know how many Jframes has opened in my whole application ?
    and
    How can I get them ?
    Can someone help me, please ?
    Thanks.
    wmiro.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FrameTest
        static JLabel label;
        static int
            frameCount = 0,    // number of visible frames
            frameNumber = 0;   // consecutive frame number
        public static void main(String[] args)
            label = new JLabel("frame count = 0", JLabel.CENTER);
            JButton addButton = new JButton("add frame");
            addButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    makeNewFrame(++frameCount);
                    label.setText("frame count = " + frameCount);
                    label.repaint();
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.fill = gbc.HORIZONTAL;
            panel.add(label, gbc);
            JPanel northPanel = new JPanel();
            northPanel.add(addButton);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(northPanel, "North");
            f.getContentPane().add(panel);
            f.setSize(175,120);
            f.setLocation(50,50);
            f.setVisible(true);
        private static void makeNewFrame(int count)
            final JFrame f = new JFrame(String.valueOf(++frameNumber));
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    reportFrameClosing();
                    f.dispose();
            f.getContentPane().add(new JLabel("frame " + frameNumber));
            f.setSize(140,70);
            f.setLocation(175 + count*40, 120 + count*80);
            f.setVisible(true);
        public static void reportFrameClosing()
            frameCount--;
            label.setText("frame count = " + frameCount);
            label.repaint();
    }

  • HT201342 Is there any way to find a log of the send e-mail from ICloud.. to analyse how many email has been send and deleted within a day from send items

    Is there any way to find a log of the send e-mail from ICloud.. to analyse how many email has been send and deleted within a day from send items

    Thx Winston,
    I can count the send item. But let me try to explain why did I ask this question.
    I had a trouble in sending e-mails from icloud on 22/2 and when I saw in my send item there were no emails.
    But the mesgs to whom I emailed received and out of which only few of them didn't got the email. So I wanted to know the log abt the outflow of the mesg with subject and the receipants email id and the list with attachment or not.
    How and where will I get the information apart from send item and draft mesg and the outflow undelivered?
    Regards
    Sarfaraz

  • How do I know how many gb has my computer?

    I need to know how many gb has my computer... how can i check that?

    If you are interested in RAM, click on  icon in the Menu Bar and then 'About this Mac''
    If you want to know about your HDD, Go to System Profiler>Hardware>Serial-ATA
    Ciao.

  • How to get Reports for specific User that how many password has been reset using FIM SSPR in FIM 2010 R2 SSPR

    Hi,
    How to get Reports for specific User that how many password has been reset using FIM SSPR in FIM 2010 R2 SSPR
    Regards
    Anil Kumar

    Hello there Anil,
    A simple way to quickly get a overview is to look at the request history within the portal environment (note that this will expire in a few day based on your environment, after that you would need to FIM Reporting Module - but you could increase this to
    maybe 60 days to so, watch the DB size).
    To do this you could create some custom search scopes of do some custom queries. The creator of the SSPR activities always has the same GUID so you can use that so search.
    In your search scope you can use the following XPath to play with.
    - All Password Reset Requests - /Request[Creator='b0b36673-d43b-4cfa-a7a2-aff14fd90522' and Operation='Put']
    - All Completed Password Reset Requests - /Request[Creator='b0b36673-d43b-4cfa-a7a2-aff14fd90522' and RequestStatus=‘Completed']
    You can play with the "RequestStatus".
    Hope this helps.
    Almero Steyn (http://www.puttyq.com) [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or "Helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer
    faster.]

  • I need to know how many objects i got selected

    Hi all,
    I need to know how many objects i got selected for a particular issue and ussualy are too many to count one by one. I know that this information is provided in other software like Corel or Freehand, but I didn't find out how to get this info in Illustrator.
    Any idea?
    Thanks

    Open the Document Info palette.
    From its flyout menu, turn on Selection Only and Objects.
    The palette will not remember those settings. You have to re-select them every time you relaunch Illustrator.
    The Document Info palette is a half-baked hack, tagged-on to display a subset of the information in the normally-hidden programmer's window, instead of incorporating the data properly into the program's interface. So it's another completely unintuitive grab-bag of important information that everyone needs, but no one would expect to look for there.
    JET

  • Hi, please, anybody knows how many coolers has an iMac 27 Intel core i5? The widget iStatpro shows 3. I changed my HD (the previous one of 1TB crashed) and after that the HDD cooler is constantly working at 4.600 rpm. Anybody is facing this problem?

    Hi, please, anybody knows how many coolers has an iMac 27 Intel core i5? The widget iStatpro shows 3. I changed my HD (the previous one of 1TB crashed) and after that, the HDD cooler is constantly working at 4.600 rpm. Anybody is facing this problem?

    Did you replace the HD yourself? If so what HD did you use?
    You should be aware that the symptom you describe is likely to be because you've used an incompatible HD. The current Macs have the temperature sensor actually in the HD package, with a modified cable to connect to the logic board.
    If the sensor is not in circuit, the fans will run full tilt all the time.
    Also, if it was under warranty, I think you'll find you've just voided it.

  • How can i get a counter to tell me how many checkboxes have been selected?

    package arabiclanguagelearning;
    import java.awt.BorderLayout;
    import java.awt.Frame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import java.awt.Rectangle;
    import javax.swing.JTextArea;
    import com.borland.jbcl.layout.VerticalFlowLayout;
    import javax.swing.JLabel;
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Toolkit;
    import java.awt.Image;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.CheckboxGroup;
    import java.awt.event.ItemListener;
    import java.awt.event.ItemEvent;
    import java.awt.event.KeyEvent;
    * <p>Title: Arabic Language Learning</p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2007</p>
    * <p>Company: </p>
    * @author iPortal
    * @version 1.0
    public class ReadingTest extends JDialog implements ItemListener{
        //ImageIcon myImage = new ImageIcon("image.jpg");
        JPanel panel1 = new JPanel();
        JLabel jLabel1 = new JLabel();
        JLabel jLabel3 = new JLabel();
        JButton jButton1 = new JButton(new ImageIcon ("image.jpg"));
        ButtonGroup question1 = new ButtonGroup();
        CheckboxGroup question2 = new CheckboxGroup();
        JTextArea question1Text = new JTextArea();
        JRadioButton q1A = new JRadioButton();
        JRadioButton q1B = new JRadioButton();
        JRadioButton q1C = new JRadioButton();
        JTextArea question2Text = new JTextArea();
        JTextField question2TextArabic = new JTextField();
        JCheckBox jCheckBox1 = new JCheckBox();
        JCheckBox jCheckBox2 = new JCheckBox();
        JCheckBox jCheckBox3 = new JCheckBox();
        JCheckBox jCheckBox4 = new JCheckBox();
        JLabel jLabel2 = new JLabel();
        StringBuffer choices;
        //will keep a count on how many checkboxes selected for question 2
        int count;
        JLabel jLabel4 = new JLabel();
        JLabel jLabel5 = new JLabel();
        JLabel jLabel6 = new JLabel();
        JButton Submit = new JButton();
        JLabel jLabel7 = new JLabel();
        public ReadingTest(Frame owner, String title, boolean modal) {
            super(owner, title, modal);
            try {
                setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                jbInit();
                pack();
            } catch (Exception exception) {
                exception.printStackTrace();
        public ReadingTest() {
            this(new Frame(), "ReadingTest", false);
        private void jbInit() throws Exception {
            panel1.setLayout(null);
            this.getContentPane().setLayout(null);
            jLabel1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 24));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setIcon(null);
            jLabel1.setText("Welcome to the reading tutorial");
            jLabel1.setBounds(new Rectangle(49, 4, 509, 67));
            jLabel3.setFont(new java.awt.Font("Tahoma", Font.PLAIN, 14));
            jLabel3.setToolTipText("");
            jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel3.setHorizontalTextPosition(SwingConstants.CENTER);
            jLabel3.setText(
                    "Please answer the questions below after reading the text");
            jLabel3.setVerticalTextPosition(SwingConstants.TOP);
            jLabel3.setBounds(new Rectangle(48, 83, 515, 60));
            jButton1.setBounds(new Rectangle(509, 63, 98, 44));
            jButton1.setText("Hide me!");
            jButton1.addActionListener(new ReadingTest_jButton1_actionAdapter(this));
            question1Text.setBackground(Color.lightGray);
            question1Text.setFont(new java.awt.Font("Tahoma", Font.BOLD, 14));
            question1Text.setEditable(false);
            question1Text.setText("What is the first letter of the arabic alphabet?");
            question1Text.setBounds(new Rectangle(64, 158, 319, 19));
            q1A.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1A.setText("?");
            q1A.setBounds(new Rectangle(60, 189, 93, 23));
            q1B.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1B.setText("?");
            q1B.setBounds(new Rectangle(60, 214, 93, 23));
            q1C.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1C.setText("?");
            q1C.setBounds(new Rectangle(60, 241, 93, 23));
            question2Text.setBackground(Color.lightGray);
            question2Text.setFont(new java.awt.Font("Tahoma", Font.BOLD, 14));
            question2Text.setEditable(false);
            question2Text.setText(
                    "Choose the two correct words which finish the sentence.");
            question2Text.setBounds(new Rectangle(64, 281, 402, 19));
            question2TextArabic.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            question2TextArabic.setText("?? ????? ??????? ___ ???? ___ ?? ???????");
            question2TextArabic.setBounds(new Rectangle(63, 311, 404, 30));
            this.setForeground(Color.white);
            jCheckBox1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox1.setText("????");
            jCheckBox1.setBounds(new Rectangle(63, 356, 81, 23));
            jCheckBox1.addActionListener(new ReadingTest_jCheckBox1_actionAdapter(this));
            jCheckBox1.addItemListener(this);
            jCheckBox2.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox2.setText("????");
            jCheckBox2.setBounds(new Rectangle(162, 356, 81, 23));
            jCheckBox2.addItemListener(this);
            jCheckBox3.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox3.setText("??????");
            jCheckBox3.setBounds(new Rectangle(260, 356, 81, 23));
            jCheckBox3.addItemListener(this);
            jCheckBox4.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox4.setText("?????");
            jCheckBox4.setBounds(new Rectangle(359, 355, 81, 23));
            jCheckBox4.addItemListener(this);
            jLabel2.setText("jLabel2");
            jLabel2.setBounds(new Rectangle(63, 402, 234, 32));
            jLabel4.setText("jLabel4");
            jLabel4.setBounds(new Rectangle(63, 433, 254, 28));
            jLabel5.setText("jLabel5");
            jLabel5.setBounds(new Rectangle(63, 465, 194, 37));
            jLabel6.setText("jLabel6");
            jLabel6.setBounds(new Rectangle(63, 500, 258, 32));
            Submit.setBounds(new Rectangle(507, 575, 115, 52));
            Submit.setText("Submit");
            Submit.addActionListener(new ReadingTest_Submit_actionAdapter(this));
            jLabel7.setText("jLabel7");
            jLabel7.setBounds(new Rectangle(472, 480, 95, 34));
            question1.add(q1A);
            question1.add(q1B);
            question1.add(q1C);
            this.getContentPane().add(panel1, null);
            this.getContentPane().add(Submit);
            panel1.add(jLabel1);
            panel1.add(jLabel3);
            panel1.add(q1A);
            panel1.add(q1B);
            panel1.add(q1C);
            panel1.add(question1Text);
            panel1.add(question2Text);
            panel1.add(question2TextArabic);
            panel1.add(jCheckBox1);
            panel1.add(jCheckBox2);
            panel1.add(jCheckBox3);
            panel1.add(jCheckBox4);
            panel1.add(jButton1);
            panel1.add(jLabel6);
            panel1.add(jLabel5);
            panel1.add(jLabel4);
            panel1.add(jLabel2);
            panel1.add(jLabel7);
            panel1.setBounds(new Rectangle(10, 10, 623, 549));
        public void jButton1_actionPerformed(ActionEvent e) {
            this.setVisible(false);
        public void itemStateChanged(ItemEvent e) {
            int index = 0;
            char c = '-';
            Object source = e.getItemSelectable();
    //count variable works fine in this part
            if (source == jCheckBox1) {
                index = 0;
                c = 'c';
                //assign new string variable the value of text for the checkbox
                String textSelected = jCheckBox1.getText();
                jLabel2.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox2) {
                index = 1;
                c = 'g';
                String textSelected = jCheckBox2.getText();
                jLabel4.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox3) {
                index = 2;
                c = 'h';
                String textSelected = jCheckBox3.getText();
                jLabel5.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox4) {
                index = 3;
                c = 't';
                String textSelected = jCheckBox4.getText();
                jLabel6.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            //Now that we know which button was pushed, find out
             //whether it was selected or deselected.
    //count variable does not work in this section.
             if (e.getStateChange() == ItemEvent.DESELECTED) {
                 c = '-';
                 Object deselectedItem = e.getItemSelectable();
                 if (deselectedItem==jCheckBox1)
                     jLabel2.setText("You deselected checkbox 1");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox2)
                     jLabel4.setText("You deselected checkbox 2");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox3)
                     jLabel5.setText("You deselected checkbox 3");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox4)
                     jLabel6.setText("You deselected checkbox 4");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
       

    you can call your_checkbox.isSelected() to know whether it's selected for all your check boxes !
    suppose you have an jcheckbox array : JCheckBox[] myCheckBoxArray = ...;
    int counter = 0;
    for(int i=0; i<myCheckBoxArray.legth; i++){
      if(myCheckBoxArray.isSelected())
      counter++;
    }and that's all

  • NOKIA6210 NAVIGATOR:HOW MANY TIMES HAS BEEN RECEIV...

    Hello
    Is urgent, please.
    In other nokia models I could see - at received calls- how many times a single number( the same number) has called. for example:le´ts suppose the number 123( a friend of you) called you 3 times yesterday. How could you see these 3 calls with their respective hours with the 6210 navigator?
    Thank you very much for your help.

    You can see that in the log application.
    Not the call log that you get by pressing the green key but the full log accessible through the phone's menus.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • Hi, I'd like to know how SAP CRM has been 'tailored' for the High Education sector?  Is it basically the same product than the existing CRM or a totally different syste,?  Where has it been implemented?  Is there an existing document/presentation about it

    Hi, I'd like to know if the SAP CRM solution for High Ed is the same product thant the existing CRM solution?  Or has it been 'tailored' for High Ed? If so, how?  Is there existing documentation/presentation about it?  Where has it been implemented?
    Thanks!
    Sylvie from Montreal

    Ged,
    whilst generally I agree with you a question (or two) for clarification so we can be sure we're not comparing apples with oranges
    I'm not familiar with O2's product lineup but given you're on Annex M is that a business package?
    Are you on an Infinity residential or business package?
    On the subject of the offshore support teams my experience from the other sife of the fence is that many, many of them are very technically orientated. The problem is that the ISPs they work for don't give them access to many of the tools that are needed (they need to raise internal requests to even get line checks done in some cases) and also they are very heavily scripted & monitored in what they do/say on a call.
    Sounds like O2 are operating as a contact centre rather than as a call centre which is much more preferable from the customers point of view.
    DISCLAIMER: although I work in the industry I do not work for BT and any opinions given are purely my own.

  • How to Know, No. of Rows has been Update, throught Triggers

    Hi all,
    I am having problem in after update trigger. I want to know How many rows has been updated by a sql statement, for that I have written on (AFTER UPDATE TRIGGER ON EMP). But it is not giving any result. I am executing Update statement from
    Sqlplus (UPDATE EMP SET SAL=23 WHERE EMPNO=7369;) We cant use Commit, and dbms_output.put_line in trigger. thats why I have used exception.
    CREATE OR REPLACE TRIGGER EMP_UPDATE AFTER UPDATE ON EMP
    DECLARE
    NO      NUMBER;
    NOROW      EXCEPTION;
    PRAGMA      EXCEPTION_INIT(NOROW, -20101);
    BEGIN
    NO:=SQL%ROWCOUNT;
    IF NO<>0 THEN
    RAISE_APPLICATION_ERROR(-20101,'Some Rows UPDATED');
    END IF;
    END;

    Hi Sachindra
    What SQL*Plus version you are using?
    Some versions that come with forms6i they dont write the number of rows updated, they just write operation 44 succeeded or something like that.
    But if you use the SQL*Plus database client (sqlplusw.exe or sqlplus.exe) which those 2 get installed with the db you will be able to see the number of rows update/deleted/inserted
    SQL> conn scott/tiger
    Connected.
    SQL> DESC EMP
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    SQL> UPDATE EMP SET SAL = 23 WHERE EMPNO = 7369;
    1 row updated.
    SQL>
    Hope this helps
    Regards
    Tony G.

  • How to know how many records is returned by the query in report

    Hi
    i want to know how many records has been returned by a sql statement in a report.
    can any one help me to solve this problem.
    santosh.

    you need to create a summary column with count function for a column in your select query. then u can print that formula column to know the no of rows selected in a query for a report

  • How do I know how many bytes it has read so far ?

    Like in a FileInputStream.read(byte [] b) method. How do I know how many bytes have been read into b so far ? Thanks!

    You can't directly as the method block, however it return the number of bytes that could be read. To achieve what you want I would create a wrapper class that would override read(byte[] b) and process it byte by byte with:
    int size = b.length;
    for(int i = 0; i < length; i++)
        int r = wrapped.read();
        if( r != -1 )
            b[i] = (byte)r;
            readSoFar++;
    }

  • How do I know what item has been selected in a select list?

    I built a select list where the user selects one item from the list and then searches using the searchfield. I need to know what item has been selected in the select list so that I can do branching and branch the user to a particular page. Can someone tell me how I can accomplish this?
    So if I want to search for Tea in the drinks category I would need to click on Drink in the select list and then type "Tea" and select search. After that I get redirected to a table called "Drinks" and there the search results will be displayed. please help!

    I tried to mach expressions... I made a simple list(with redirection):
    STATIC:Yes;Y,No;N and it displays fine. I then try to do branching where exp1=exp2 Where I tried to have the label "X" for E1 and "Y" for E2 and nothing happened. I tried to use the name of the list Xlist and it failed too. I tried Request=exp1 and didnt work either. I set the source for the list as static. I am not sure what I am doing wrong. When i tried !=exp nothing happened either... perhaps the values I am using are wrong? Pleas help me out.

Maybe you are looking for