How to create and use a new jbutton method?

hi i'm making a program which has a lot of buttons so i decided to create a jbutton method, here it is
public JButton newButton(String url, String url2)
          URL imgURL = MachineInterface.class.getResource(url);
          ImageIcon icon = new ImageIcon(imgURL);
          JButton button = new JButton(icon);
          button.setBorder(null);
          Cursor cursor = new Cursor(Cursor.HAND_CURSOR);
          button.setCursor(cursor);
          URL imgURL2 = MachineInterface.class.getResource(url2);
          ImageIcon icon2 = new ImageIcon(imgURL2);
          button.setPressedIcon(icon2);
          return button;
     }the button shows up alrite if i do it like this
panelEastSouth.add(tm.newButton("images/10p.png", "images/10pIn.png"));but i would like to do it like this
newButton button10 = new newButton("images/10p.png", "images/10pIn.png");
          button10.addActionListener(this);i want it like this so i can add actionlisteners to them.
how do i make this work?
thanks
brad

newButton is a method returning a JButton, not a class, so it would be just
JButton button10 = newButton("images/10p.png", "images/10pIn.png");
button10.addActionListener(this);

Similar Messages

  • How to create and implement a new work schedule rule successfully?

    Dear Community,
    How to create and implement a new work schedule rule successfully?
    In other words, what are all the basic steps to create and implement a new work schedule rule successfully?
    Thanks in advance.

    Hi,
    Follow the below steps to create Work Schedule:
    Holiday Calendar
    Transaction Code: SCAL
    Holiday calendar comprises of list of paid holidays to be given to employees on festivals by the company.
    Personnel Area/SubArea Groupings
    Go to SPRO --> Time Management --->Work Schedules --> Personnel SubArea Groupings
    Maintain perosnnel area/Subarea groupings for work schedule.
    i.e. Suppose in Mumbai you have WS = GEN ( 10 to 6) and in Chennai you have WS = NORM ( 8 to 4 )
    Work Schedule
    Go to SPRO --> Time Management --->Work Schedules -->Daily Work Schedules
    Go to SPRO --> Time Management --->Work Schedules -->Period Work Schedules
    Daily Work Schedule is actually your office timings with breaks (paid /unpaid) i.e. Planned Working Time which is then included
    in Period Work Schedule to make a week ( M T W T F S S )
    Daily Work Schedule (i.e. Day) -
    > Period Work Schedule (i.e. Week)
    Work Schedule Rules
    Go to SPRO --> Time Management --->Work Schedules -->Work Schedule Rules and Work Schedules
    After doing above mentioned configurations,maintain employee group/subgroup groupings in which you have to define which calendar is applicable for which type of employees for which work schedule.
    You will maintain this work schedule in infotype 0007 - Planned Working Time of employee via transaction code - PA30

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • How to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    how to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    See the below discussion
    How to create and use Webservice controls using WSDL in weblogic portal10.3
    Thanks,
    Venkat Sarvabatla

  • How to create and use dynamic queue in JMS

    Plz tell me how to create and use a dynamic queue in jms and can reciever file lookup it as it lookup any server configurred queue(written in the server).

    Hi,
    We can use Azure File services to do this, for more information, please have a look at this article:
    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The Azure File service exposes file shares using the standard SMB 2.1 protocol. Applications running in Azure can now easily share files between
    VMs using standard and familiar file system APIs like ReadFile and WriteFile.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Where can I learn how to setup and use the new features in Mountain Lion?

    Where can I learn how to setup and use the new features in Mountain Lion?

    MacWorld has a Superguide, TidBITS has Take Control books, and probably a flock of other publishers have physical books.

  • Data Modeller: how to create and use collection type

    Hello,
    basically subj. I'm not clear how to ( for example ) create and use the data type based off the varray data type.
    Please advise.
    thank you
    andrew

    Hi Andrew,
    you can create collection types (varray/table) in two ways:
    1) in browser - find "Data Types">"Collection types" node use pop-up menu - it's just "create new collection type" there
    2) in Data types model diagram - you can create collection of "certain structured type" or collection of references to it - use "new Collection ..." tool and first click on referred structured type and after that on structured type that will hold the collection - new attribute is added in latter type and if there is no such collection type already defined new collection type is created and you can edit it later.
    Philip

  • How do I create AND USE a new iTunes account?

    Hi there,
    My girlfriend has finally traded in her windows (*spits*) phone for an iphone after months of me drilling it into her that her phone sucked... The problem now is that we share a PC and she wants to fill her spanking new iphone with crap music. So we have a folder set up ready to drag into a fresh new itunes library but upon plugging her phone in it pops up with "synching Adam's iphone" First off... How do I tell itunes that it's making a mistake and that this new device is not my phone without hurting it's feelings? We have tried going to the itunes store and logging in with her apple ID but it still tries synching Adam's iphone and filling her phone with my goodies...
    I'm assuming it's doing this because my apple ID is attached to the itunes program on my windows (*spits*) PC... So if this is the case then how do I unattach it and attach my girlfriends ID in order to fill her phone with the worst music known to mankind? Also I'm running the latest version of itunes with windows 8 OS (*spits*)
    On a side note, if you haven't already gathered I'm an avid apple fan and as soon as I can afford it I'll be trading in my piece of... Trading in my PC for a mac however as an avid apple fan I'm frankly disappointed with the design quality of the itunes software... Why is it so complicated? Everything apple I've ever owned has been so simple and user  friendly that I've never looked back... Then I come across this monstrosity of a program labeled itunes... Call it blasphemy but it almost reminds me of a badly designed windows program... You know like... all of them? Anyways I'm ranting now so I'll shup and let you answer the original question lol
    Thanks in advance guys.
    Adam.

    Hello Poggerz
    The best way to keep data separate is to create a different user for just her. That way there is no data getting crossed. The reason it said your name on her iPhone is probably that is what your user name is for your computer. Check out the article below for more detailed information to set that up.
    How to use multiple iPhone, iPad, or iPod devices with one computer
    http://support.apple.com/kb/ht1495
    Regards,
    -Norm G. 

  • How to create and use a boot volume clone?

    Hello. My name is Cassiano and I'm NOT a system administrator. I'm an architect. I design and build houses, not systems. And the reason I'm telling you that is because I need your help.
    The short version of my problem is this: "How do I create a boot volume clone", but I think I need to tell you the whole story.
    Here at the office I work we have 18 iMacs and 1 Xserve running OS X Server 10.4.9.
    Although I'm an architect I'm responsible to keep the computers up and running.
    This is not because I want, but just because I'm the one here that knows a bit more about this stuff and although I'm not an expert, I know quite a lot about this stuff. I did pretty much everything here. Configured the network, firewall, installed the Xserve, etc, but of course that if something breaks we just take the computer to apple store and wait for it to be fixed
    The Xserve has 3 HDs inside. 1 at bay1 which is the boot and 2 others on bay2 and bay3. The HDs on bay2 and bay3 are working as one using SoftRAID and we use this volume to store all of our data. That is the reason we chose to mirror them using softRaid. If one fails, the other has everything and we just have to get a new one.
    Last week we decided to setup the Xserve to be our mail server as well, so I turned on the Mail Service and after a lot of reading I managed to configure it correctly. In fact we have our MX records pointing to a company that relays the email to our Xserve, so it is not really accessible from the outside world.
    But this Mail thing made me loose my sleep. The reason is: before that our Xserve was used only as a file repository. So if it would break or something all we have to do is take the HD out of it, send it to apple store and plug the HD on another computer. All of our files would be safe and everybody would be happy. Of course this is an over simplificated situation, but that is pretty much how it would go.
    But now everything is different. Every person here has the email account configured to the Xserve, which means that if it breaks or something goes wrong, no one will be able to send or receive emails. The new messages will not be lost, because the company that relays the emails to us will keep them there, but things will get chaotic here.
    When reading this document here: http://developer.apple.com/documentation/MacOSXServer/Conceptual/XServerProgrammingGuide/Articles/abpinstall.html I saw this section that said: "Cloning the Boot Volume"
    Where it says: The use of the boot volume clones is entirely to ensure the highest availability possible for your system volume, not your client data.
    So, finally, my question is. How do I implement this "boot volume clone"? If I buy a new HD and place it on bay4 will I be able to do that? How?
    After doing it if something goes wrong how do I use the "clone volume"?
    Thank you for your patience and any help is greatly appreciated.
    Best regards,
    Cassiano Forestier
    Specs of the Xserve
    Machine Name: Xserve
    Machine Model: Xserve1,1
    Processor Name: Dual-Core Intel Xeon
    Processor Speed: 2 GHz
    Number Of Processors: 2
    Total Number Of Cores: 4
    L2 Cache (per processor): 4 MB
    Memory: 1 GB
    Bus Speed: 1.33 GHz
    Boot ROM Version: XS11.0080.B00
    SMC Version: 1.11f5
    LOM Revision: 1.2.1

    Yes, your server is becoming central to your business universe. Mine, too.
    Boot from DVD, and use Disk Utility to create the clone. Another way of looking at this is as a photocopy or snapshot or block-by-block copy of the state of the disk at the moment the clone is made. You can then either boot from the clone (if needed; assuming the clone is on a bootable device), or boot from the DVD and copy the clone back to the original (or replacement) disk; this restores the disk state to that of the time the clone was made.
    Yes, you'll need a disk to clone to. Probably more than one, since you'll probably want to set up a rotating pool, should you need to go back to an older snapshot.
    You're undoubtedly also approaching a requirement for either an add-on storage array or storage shelf via one of your PCI-X or PCIe I/O expansion slots, or adding a FC SAN into an open PCI-X or PCIe slot and adding the external FC SAN Xserve RAID configuration that Apple sells.
    The external storage can be "just a bunch of disks (JBOD)" in an external disk shelf, or an external RAID via add-in eSATA or add-in SCSI controller, or via Fibre Channel for the Xserve RAID configuration for the FC SAN configuration, or (for lower speeds) FireWire or (lowest) USB.
    If your data is worth it and you want to deal centrally with Apple and your budget allows it (qv: "if your data is worth it"), Xserve RAID is the way to go. The external storage shelf is certainly a feasible approach -- but you'll likely end up dealing with a third-party for the configuration, set-up and third-party storage gear.
    If you're looking for things that can go wrong here, recognize that RAID only protects against drive failure. RAID does not protect against accidental nor malicious file deletions, fat-fingered operator commands, nor against application or system-level disk corruptions. RAID (only) seeks to protect against disk errors. This gets into tapes, or near-line disk copies, or other such media. External tape, or other such archival media, and particularly media that can be sent off-site on a regular basis.
    It's good that you're thinking about this stuff, too.

  • How to Create and Use MQ Adapter(IBM MQ Series) in BPEL

    Hi,
    I am using Oracle SOA Suite 10.1.3.3.
    I am very new to the Usage of MQ Adapter(IBM MQ Series) in BPEL.
    what is the procedure to create our own Message Queues(i.e., MQ Series)?
    It would be great if anybody share the idea of how to create the MQ and usage of same in BPEL Workflows.
    is it mandatory to install websphere to create the MQ?
    If possible,share the related docs for the same.
    Any suggestions/views will be great.
    Cheers,
    Balaji
    Edited by: user580285 on Nov 4, 2008 5:44 AM

    Hi,
    Kindly refer to the BPEL Dev Guide and in that please refer to the Appendix which contains MQ Series Adapter.
    For this you need to provide the details like: -
    MQ Server Host, port, queue manager name etc. Also you need not to install IBM Websphere MQ, you can work on it remotely as well.

  • How to create and use scales for DAQ-6014 in Labview?

    Hello,
    In my application, I use the DAQmx-driver to read the 16 analog input terminals of my DAQ-Card. I create a task with all the 16 channels and define for each channels the input domain (from 0 to 10V) and configure them as NRSE. Then I configure my task to measure the waveforms during 10s with 1000 Hz each time I need it.
    The waveform I measure are raw data and I need to scale them to get a mesurement with physical signification. This is actually done after each measure, which costs a lot of time (almost 5 seconds). Then I tried to use the DAQmx Create Scale.vi to create scales and attach them to the channels during my task creation. The creation of scale works fine and I can attach them to the channels. But when I do my measure, I get the raw data - unscaled.
    I have no idea, what I am doing wrong. I look for some examples on how to use the DAQmx Create Scale.vi but I can't find none.
    Does anybody already have some experiences with this VI?
    Cheers,
    Olivier

    Hi,
    May be I don't get exactly what you mean with:
    "Right click On DAQmx read and check the options with DAQmx AI read (it is a polymorphic VI) ."
    I set the DAQmx read polymorphic VI to the option "Analog 1D Wfm NChan NSamp".
    Anyway, I send you 3 VI:
    - NIDAQ_6014_CreateScales.vi: where I create my scales
    - NIDAQ_6014_StartAIN_Scaled.vi: where I create my task and use the scales
    - Measure.WaveFormReader.vi: where I read my data
    May can you see what is wrong.
    Cheers.
    Attachments:
    Measure.WaveFormReader.vi ‏39 KB
    NIDAQ_6014_CreateScales.vi ‏22 KB
    NIDAQ_6014_StartAIN_Scaled.vi ‏29 KB

  • How to create and use Webservice controls using WSDL in weblogic portal10.3

    Hi All,
    I have WSDL , How to create webservice controls using the WSDL in weblogic portal 10.3 and use those controls to invoke those webservice methods?
    please give me the documents links for this.
    Thanks
    Venkata Sarvabatla

    As far as I remember, Controls can be called only from Pageflows, BackingFiles, Another Control (Like control calling another control) etc. In pageflow we use annotation @Control and give control classname and a varialbe for that. I am pretty sure this annotation may not work from normal java class and in your case a JAVA JSR Class.
    If you installed the samples, refer the samples from WLS: C:\beawlp103\wlserver_10.3\samples\server\examples\src\examples\webservices. They have lot of fully ready to work samples with instructions. I used clientgen ant task. But you can use standard SUN JDK Command "wsimport" also to generate the java files from the WSDL. Open any command prompt. If java is in classpath, just run wsimport and that should give an idea.
    Goud

  • How to create and use a node globally  as well as internal table

    HI,
    Kindly let me know how can I create a node & internal table globally and which I can use them in various methods in view and controller as well, if u can provide an example it could be very help full.
    my requirment is uploading a multiple files in wdp ABAP for this I just followd the link below
    http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP
    which for single upload and for making this for multiple upload I need a node could be usefull globally or a IT please check my code below
    DATA lo_nd_n_upload TYPE REF TO if_wd_context_node.
        DATA lo_el_n_upload TYPE REF TO if_wd_context_element.
        DATA ls_n_upload TYPE wd_this->element_n_upload.
        DATA lo_nd_n_file_download TYPE REF TO if_wd_context_node.
        DATA lt_n_file_download TYPE wd_this->elements_n_file_download.
        data ls_file_upload TYPE ZFILE_UPLOAD1.
       ZFILE_UPLOAD_1 = wd_componentcontroller->Elements_ZFILE_UPLOAD_1.
         t_file_upload = ig_componentcontroller->ITAB1.
       t_file_upload = wd_this->zfile_upload1.
       navigate from <CONTEXT> to <N_FILE_DOWNLOAD> via lead selection
         lo_nd_n_file_download = wd_context->get_child_node( name = wd_this->wdctx_n_file_download ).
      navigate from <CONTEXT> to <N_UPLOAD> via lead selection
        lo_nd_n_upload = wd_context->get_child_node( name = wd_this->wdctx_n_upload ).
      get element via lead selection
        lo_el_n_upload = lo_nd_n_upload->get_element( ).
      @TODO handle not set lead selection
        IF lo_el_n_upload IS not INITIAL.
      get all declared attributes
        lo_el_n_upload->get_static_attributes(
          IMPORTING
            static_attributes = ls_n_upload ).
    ls_n_upload will contain the File name file type and file contents *
       ls_n_upload-file_size = xstrlen( ls_n_upload-file_content ).
       ls_file_upload-FILE_NAME = ls_n_upload-FILE_NAME.
       ls_file_upload-FILE_TYPE = ls_n_upload-FILE_TYPE.
       ls_file_upload-FILE_SIZE = ls_n_upload-FILE_SIZE.
       ls_file_upload-FILE_CONTENTS = ls_n_upload-FILE_CONTENT.
       append ls_file_upload to t_file_upload.
       clear ls_file_upload.
    lo_nd_n_file_download->bind_table( new_items = t_file_upload set_initial_elements = abap_true ). 
    ENDIF.
    so here I would like use t_file_upload(node or IT ) to use globaly which can keep the previous data and I can add the existing data and in another method I would like to submit the data in t_file_upload to table
    Regards
    raj

    Hi Chandra,
    Resloved, I createa table type in SE11 by giving my table name as a line type and I used that as a Global IT in view "attributes" tab and I made the my code as follows its working now
        DATA lo_nd_n_upload TYPE REF TO if_wd_context_node.
        DATA lo_el_n_upload TYPE REF TO if_wd_context_element.
        DATA ls_n_upload TYPE wd_this->element_n_upload.
        DATA lo_nd_n_file_download TYPE REF TO if_wd_context_node.
        DATA lt_n_file_download TYPE wd_this->elements_n_file_download.
        data ls_file_upload TYPE ZFILE_UPLOAD1.
        data t_file_upload TYPE standard table of ZFILE_UPLOAD1.
       navigate from <CONTEXT> to <N_FILE_DOWNLOAD> via lead selection
         lo_nd_n_file_download = wd_context->get_child_node( name = wd_this->wdctx_n_file_download ).
      navigate from <CONTEXT> to <N_UPLOAD> via lead selection
        lo_nd_n_upload = wd_context->get_child_node( name = wd_this->wdctx_n_upload ).
      get element via lead selection
        lo_el_n_upload = lo_nd_n_upload->get_element( ).
      @TODO handle not set lead selection
        IF lo_el_n_upload IS not INITIAL.
      get all declared attributes
        lo_el_n_upload->get_static_attributes(
          IMPORTING
            static_attributes = ls_n_upload ).
    ls_n_upload will contain the File name file type and file contents *
       ls_n_upload-file_size = xstrlen( ls_n_upload-file_content ).
       ls_file_upload-FILE_NAME = ls_n_upload-FILE_NAME.
       ls_file_upload-FILE_TYPE = ls_n_upload-FILE_TYPE.
       ls_file_upload-FILE_SIZE = ls_n_upload-FILE_SIZE.
       ls_file_upload-FILE_CONTENTS = ls_n_upload-FILE_CONTENT.
       append ls_file_upload to ME->wd_this->gt_file_upload .
       clear ls_file_upload.
    lo_nd_n_file_download->bind_table( ME->wd_this->gt_file_upload ).
       endif.
    thanks for the support.
    Regards
    Raj

  • SAP Query-for  Reporting   how to create and use it

    Hi SAP Gurus,
    i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
    also if you have any study material on steps on How to write and create queries for PP module
    thank you very much

    Hi
    Please refer below document
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Also refer below
    How to Create Infoset Query (SAP Query)
    Steps on how to proceed to create a Query:
    ADHOC QUERY
    A query can be created to extract information from master records  i.e  Infotypes.  For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
    Proceedure :  
    Decide on  the various Infotypes we  want to make the query.  Decide on the area where we  want to query  i.e  Global area or Standard area.  Standard area is client specific and globel area will include all clients.
    Menu : HR – PM – Admn -  Information System -  Adhoc Query
    Select area standard and select the  user group already created
    Creation of new query  :  
    TC SQ03  -  Select Environment – Select Standard Area -  Enter  --  If new user group is to be created, enter name of the user group, click on create and enter necessary information and  exit after saving
    TC SQ02  -  Enter name of the Infoset – Create – enter name of Infoset -  Data source -- >  Table join by basis table – give name of table e.g  pa0000 -  Enter -  Click on insert table if we  want to include more tables – give name of table one by one and after finishing,  place cursor on the joining lines and right click to delete unwanted relationships  - check  - and go back  - field groups  -  include all table fields  - click on generate button   -  go out
    TC SQ03  -  Select user group  -   eg.  Payroll
    Infoset  - Enter name of newly created Infoset 
    Assign users and Infosets  -  Assign infosets  -  put tick on payroll  - save and go back
    TC  PAAH  -  Expand the nodes and put tick on relevant fields depending upon necessity
    Save the query  by giving the same name as infoset for easyness..
    For executing a query which is already created
    1. Go to SQ01 transaction
    2. Go to Environment menu->query areas->std areas
    3. Then choose the user group where the query is created
    4. It will display all the queries created for the group.choose the query you want to executeand click execute.
    5. will take to the initial screen
    6. Enter the required parameters and execute
    Regards
    Ranga
    Message was edited by:
            Ranganathan Srinivasamurthy

Maybe you are looking for

  • Adobe Creative Cloud Desktop causes PC to hang

    Hi there, Up to yesterday, Creative Cloud Desktop (CCD) was working fine. However, yesterday when I tried to run it, it would cause my whole system to hang. All my apps would start working. I've tried the following: 1) Stop all running applications a

  • FC Studio 2 compatible with Snow Leopard?

    H there, I am in the process of buying a new computer, upgrading from a G4. I use Final Cot Studio 2 (with FCP6) and wonder, if this is compatible with snow leopard. I tired to find an answer on this, but a lot of people seemed to have problems when

  • How to access music/pictures on PC through Sony Blu Ray?

    I just bought and set up a Sony blu ray BDP-S570.  I have connected to my wireless internet as I access Pandora & You Tube.  But I want to access my music & pictures on my PC but can't make it happen.   Any suggestions on how I do this?  Thanks for y

  • ToC stops at 17?

    Hi so all my chapter titles have the exact same paragraph styles applied to them, however no matter what I try when i export to epub the toc style  for some reason stops at chapter seventeen of twenty five. Help?

  • My iPAD4th Gen is stuck on the apple logo

    And yes I've already tried hard reseting it by pressing the on/off and home button for 5-9secs. After I've did that the logo disappears as if it's going to turn back on again, the logo appears again but then it just stays there for a couple of secs a