How to repaint an array of JCheckbox witou creating new instance?

Can you help me on how I will repaint the array of check box, without creating new instance. When I pressed the refresh Button It will repaint the check box. Anybody who can help me..
Here's my code. The Comment is the one I need to put the action.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class subok extends javax.swing.JFrame {
    JCheckBox c[] = new JCheckBox[10];
    public subok() {
        initComponents();
        setSize(300,500);
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
    private void initComponents() {
        jPanel1 = new javax.swing.JPanel();
        check();
        refresh = new javax.swing.JButton();
        getContentPane().setLayout(null);
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jPanel1.setLayout(null);
        refresh.setText("Refresh");
        refresh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                repaintCheckbox(evt);
        jPanel1.add(refresh);
        refresh.setBounds(160, 260, 160, 23);
        getContentPane().add(jPanel1);
        jPanel1.setBounds(0, 0, 400, 300);
        pack();
    }// </editor-fold>                       
    private void repaintCheckbox(java.awt.event.ActionEvent evt) {                              
            // what will I put here???????
            // ANy Help will do....
            // I just want to refresh the checkbox when I pressed this button..
    public void check() {
        boolean s = false;
        int x = 10;
        for(int i = 0; i < 10; i++) {
            c[i] = new JCheckBox();
            c.setText("");
c[i].setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
c[i].setMargin(new java.awt.Insets(0, 0, 0, 0));
jPanel1.add(c[i]);
c[i].setBounds(20, x, 73, 15);
x += 30;
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new subok().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JPanel jPanel1;
private javax.swing.JButton refresh;
// End of variables declaration

what do you mean by repaint the checkboxes?
do you mean setting them all to 'unchecked'?
if so, just loop through your checkbox array c[x].setSelected(false);

Similar Messages

  • I have an iTunes account, i just bought a 4s phone. i previously had a 3g how do i start? do i choose 'create new ph' on itunes or restore to 'elaine i phone' . i picked the latter and siri is gone off the phone

    I have an iTunes account, i just bought a 4s phone. i previously had a 3g how do i start? do i choose 'create new ph' on itunes or restore to 'elaine i phone' . i picked the latter and siri is gone off the phone

    Update to what? The 3G you want to update? You have ios3 or 4 on that 3G?
    Go to a friend, authorize that pc.
    Read this : http://support.apple.com/kb/ht1848
    and this : http://support.apple.com/kb/ht2519
    Make a backup of your stuff (from the phone. apps/photos/music/blabla). Update your phone. The phone will restore the backup automatically.

  • After reversed PGI, how to kept the old delivery document and create new

    Dear expert,'
    My client has an requirement:
    Normal Sales cycle:   SO>DN>PGI...Then company found there are some issues like material is wrong..etc Then they will reverse the PGI, and adjust the DN...But they want kept this DN in status like 'closed' 'rejected'...etc.
    And then they will change the ori SO, then create an new DN, then PGI.
    My questions is how to achieve this point: " kept the old DN in status like 'closed' 'rejected'...etc.  and further create new DN after modified the SO."
    Anybody has any idea, thanks.

    hi,
    there is a process for it in include MV50AFZ1,
    FORM userexit_delete_document.
    in it create an Z table to store the deleted documents.
    for reference.
    regards,
    balajia

  • How to create new instance of an abstract?

    I just downloaded a *.jar library.
    In my code, I imported the right class.
    When I create a new instance Netbean complaints "blah is an abstract: can not instantiated"
    So when I looked at blah class code:
    It looks like this:
    public abstract class blahblah extends DataFrame
       protected blahblah(byte[] data)
          super(data);
       }huh? How can I instantiate this bad boy then?

    jverd wrote:
    firewind4000 wrote:
    huh? How can I instantiate this bad boy then?You can't. You can only instantiate a concrete subclass.Yup. There are two possibilities:
    1. BlahBlah was designed for client (you!) subclassing. You should define a concrete ( = not abstract) subclass X of BlahBlah :
    public class X extends BlahBlah {...}and then instantiate X.
    2. There is a factory method somewhere in this framework that returns objects of type BlahBlah. Use it:
    BlahBlah myObj = factory.createBlahBlah();In this case there is probably a non-public subclass of BlahBlah defined in the framework that you don't need to know the details of.

  • HOW CAN I KNOW THE FUNCTION CODE OF CREATE NEW SESSION

    <b>HOW</b> CAN I KNOW THE FUNCTION CODE OF CREATE NEW SESSION?
    THANKS...

    Hi
    Please put a "/n" (to open a new session after killing the current session)
    or "/o" (to open a new session without killing the current session)
    or "/i" (to end the current session) before the below T Codes as per your requirement...
    Try thistoo <b>O0</b>
    <u><b>demo-like programs</b></u>
    RSIMC000
    RSIMC001
    RSIMC002
    RSIMC003
    RSIMCTRX
    RSIMCTST
    Reward all helpfull answers
    Regards
    Pavan

  • How to deploy and run application in user created OC4J instance

    Hello friends,
    I have created my own OC4J instance in Application Server Control.Now,how can I deploy and run application in this newly created OC4J instance.I need your help,it's
    urgent.
    Regards
    Prasenjit

    Hi Andreas,
    Thanx for your prompt reply.Yes,I had deployed the '.ear'in that.But I am not able to run the program in
    browser.Could you please elaborate more precisely.I wouuld be obliged.
    Regards
    Prasenjit

  • How to clear the previous  filter text when creating new record??

    Dear All,
    my question is i i created table having filter and sorting.
    when i m searching data through filter text data is coming but i want to clear that text(filter text) when i am creating new record.
    for my case when i am creating new record all blank field is coming but in that filter text box previous data is coming which one i was searching.
    but i need when i will create a new record tat filter text should be clear.
    Thanks
    Damby

    Damby, please tell us your jdev version.
    Check my blog http://tompeez.wordpress.com/2011/10/29/jdev-how-to-reset-a-filter-on-an-aftable/ you can add this to the button you use to create the new record.
    Timo

  • How to create new instance of the process from external web apps?

    Hi Everyone,
    How to create a new instance of the process which deploy to the weblogic server from the external web app?
    Thank you.

    Assuming the process includes a message start event, the simplest way is to use Web Service call. Once you've deployed the process you can use Enterprise Manager to get the URL of the WSDL. There's and icon at the top of the composite summary page for getting the WSDL, or you can get it from the test page. Use that WSDL URL to construct the client to use from the web app. If it's an ADF client you can generate either an ADF Data Control or a client proxy.

  • How to avoid duplicated customer ref. no when create new sales order?

    Hi,
    In my company, we need input customer ref. no when create a new sales order, but I found there was no any validation to avoid input a existed number.
    Can somebody show me how to add some check function on this filed?
    thanks.

    Hi,
    This can be handled in standard system.
    Go to Administration> System Initialization> Document Settings>Per Document (Tab)> Select Sales Order-->Tick Block release (When duplicated  customer reference no. occurs).
    Thanks,
    Joseph

  • How can I modify the default styles or create new ones in pages for IPad?

    Hi, I have recently bought the pages for IPad App. It is nice, but I wonder How to modify the default styles or create My own ones...Can anyone help me?

    Unfortunately, pages on the iPad does not support editing styles. The mac version is an extremely powerful piece of software (I know someone who has recently completed their PhD thesis in it), but the iPad version has only a fraction of the features.
    The only word processor for the iPad I'm aware of that fully provides support for styles is UX Write - see http://www.uxproductivity.com (disclaimer: I've been involved with the development of this app). This is designed for the sort of high-end professional authoring tasks that you can do with Pages for Mac. Customisable styles are one of the most fundamental aspects of this app, and it provides extensive formatting options and the ability to define your own, new, custom styles.

  • Extending arrays without having to create new ones

    Anyone know if there's a way to append arrays in Java? Or do I have to create a new one with the length of the two together and use System.arraycopy ??

    Hi there
    There is no way to redifine the size of arrays
    but there are many other wasy of storing elemnts
    LinkedList
    Vector
    Etc
    Markus

  • How to enhance the Tcode(F871) program to create new payment request ?

    Hi
    My requirement is that create new payment request (F871)
    I want to copy the standard tcode(F871) program and make some change like invisible the field and change the level of the field .
      But when I copy the standard program of the tcode(F871) and create a zprogram with a ztcde......execute the tcode(ztcode)....it is showing error before doing any chance in the progam.
    So what change I will do in my zprogram so that when I execute the ztcode It will work...........
    Regards
    Debo

    When I execute the above message coming  below the blank screen.

  • How to create and instance of Java Object from an XML Document.

    Hi,
    How can we use a XML Document to create an instance of Java Object and do vice versa ie from the Java Object creating the XML Document.
    XML Document is available in the form of a String Object.
    Are there helper class available to achieve this.
    I need to do this in a Servlet.
    Regards
    Pramod.

    JAXB is part of JavaSE while Xmlbeans claims full schema support and full infoset fidelity.
    If the standard APIs do all that you need well then use them.

  • How do I edit and create new Spry2 menu items?

    I have manged to use adobe air to style and insert a spry2 menu - looks OK
    However,I do not undestand how to edit the menu items
    i.e. creating new menu items and adding new sub menu items
    On spry1 it was easy - just click the top of the menu and a wizard appeared at the bottom of the page
    The spry2 menu icon seems to be unclickable/greyed out?
    Can anyone help
    [email protected]

    Thanks for the reply - I already thought of that and I can edit the menu using code view (although I am not sure how you would 'see the sub menus in design view?) but I was wondering if spry2 has the same time saving wizard in the properties panel (as Spry1) that simplifies and speeds up the process?
    To restate the question: I can see a spry2 menu icon in the properties panel but it doesn't do anything as it's greyed out.
    Is there an option in dreamweaver (or adobe air which styles the menu) that makes a menu wizard work in the properties panel?
    If not then I guess I have to do it in code view - very tedious!?
    Jonathan
    [email protected]

  • How to prevent users from creating new folders in share folder directory?

    Hello guys
    I'd like to know How to prevent users from creating new folders in share folder directory but still keep their power of creating new folders in their personal 'my folder'?
    I tried changing the 'manage privilage ---- create folder' to deny certain user accounts, but by doing so, it also stops the user from creating new folders in their 'my folder', which is not good..
    I also tried going into these share folders and tried different access types such as 'change/delete', 'read', 'traverse folder' etc, but none of it work ideally. The 'change/delete' access still allows them to create new folders, 'read' access prevents creating new folders but also take away their power of saving reports..
    Any thoughts on how to take away their ability to ONLY create new folders in share folder areas without affecting their other privileges?
    Please advise
    Thank you

    Easy, on the shared folders root folder only give them 'read' or 'traverse folder' but on the the folder inside the shared folders root folder give them 'change/delete'. That means they can change anything inside those folders but not create any folders at the shared folders root level.

Maybe you are looking for