Add items in jlist

hi
im a bit confused as to how to add items to a jlist during runtime
could someone please show an example

Hi,
Maybe this will help:
http://www.exampledepot.com/egs/javax.swing/list_ListAddRem.html?l=rel

Similar Messages

  • Cant delete or add item to Jlist as nthing happens

    Hi all,
    regarding the first part where pass of string array into object array. I have done it (thanks again for the help). But regarding the add and remove elements from the Jlist cant be done.. below is my code for the delete button when press. I cast it into int for the ManualList.getSelectedIndex();(at part A) but cant display and keep having a error call
    java.lang.NullPointerException at ManualChange&ValueReporter.valueChanged
    code for value reporter is at part B
    Part A
    private void deleteMouseClicked(MouseEvent e)
    int n =(int)ManualList.getSelectedIndex();
    if (!(n < 0) || (n > listModel.size()))
    listModel.remove(n);
    delete.setEnabled(false);
    ManualList.repaint();
    ManualList.revalidate();
    Part B
    private class ValueReporter implements ListSelectionListener {
    public void valueChanged(ListSelectionEvent event) {
    // if (!event.getValueIsAdjusting())
    // gettext.setText(ManualList.getSelectedValue().toString());
    ManualList.repaint();
    ManualList.revalidate();
    Any help is greatly appreciated.
    alright, i redo part A the code is shown below but i still cant get the display out.
    Is there some problem in my code? or is the repaint and revalidate thing wrong usage here ? Need help regarding this. Thanks
    int n =ManualList.getSelectedIndex();
    if (!(n < 0) || (n > listModel.size()))
    listModel.removeElement(arrayObject[n]);
    delete.setEnabled(false);
    ManualList.repaint();
    ManualList.revalidate();

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.MouseEvent.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.swing.DefaultListModel.*;
    import java.util.Properties;
    import java.util.ArrayList;
        public class smallProgram extends JFrame //implements ListSelectionListener
            JPanel p;
        private DefaultListModel listModel;
         JLabel ManualJob = new JLabel();
         JTextField gettext  = new JTextField();
         JScrollPane scrollPane1 = new JScrollPane();
         JButton okButton = new JButton();
         JButton cancelButton = new JButton();
         JButton add = new JButton();
         JButton delete = new JButton();
         JList ManualList;
         int tokenNo;
         String real,ss;
         String[] values;
         Object[] arrayObject;
         java.util.StringTokenizer tokenizer;
         BufferedReader in;
         ArrayList data;
         public static void main(String args[])
             new smallProgram();
          public smallProgram()
                setTitle("Small Program");
                p = (JPanel) this.getContentPane();
                p.setLayout(null);
                setSize(515, 585);
                setVisible(true);
               //---- ManualJob ----
               ManualJob.setText("Manual Jobs Classification");
               ManualJob.setFont(new Font("Times New Roman", Font.BOLD, 14));
               p.add(ManualJob);
               ManualJob.setBounds(10, 435, 190, 35);
               setVisible(true);
               //---- gettext ----
               gettext.setFont(new Font("Times New Roman", Font.PLAIN, 12));
               p.add(gettext);
               gettext.setBounds(365, 435, 115, 25);
               setVisible(true);
               //Buttons for add, del, ok and cancel
               //---- Add ----
               add.setText("Add");
               add.addMouseListener(new MouseAdapter() {
                   @Override
                   public void mouseClicked(MouseEvent e) {
                       addMouseClicked(e);
               p.add(add);
               add.setBounds(355, 485, 60, add.getPreferredSize().height);
              //---- delete ----
               delete.setText("Delete");
               delete.addMouseListener(new MouseAdapter() {
                   @Override
                   public void mouseClicked(MouseEvent e) {
                       deleteMouseClicked(e);
               p.add(delete);
               delete.setBounds(new Rectangle(new Point(430, 485), delete.getPreferredSize()));
               //---- okButton ----
               okButton.setText("OK");
               okButton.addMouseListener(new MouseAdapter() {
                   @Override
                   public void mouseClicked(MouseEvent e) {
                       okButtonMouseClicked(e);
               p.add(okButton);
               okButton.setBounds(335, 520, 75, okButton.getPreferredSize().height);
               //---- cancelButton ----
               cancelButton.setText("Cancel");
               cancelButton.addMouseListener(new MouseAdapter() {
                   @Override
                   public void mouseClicked(MouseEvent e) {
                       cancelButtonMouseClicked(e);
               p.add(cancelButton);
               cancelButton.setBounds(420, 520, 75, cancelButton.getPreferredSize().height);
               ss = ("test1,test2,test3,test4,test5"); //My string ss
               int length = ss.length();
               int asd = (ss.indexOf('_'))+1;
               real = ss.substring(asd, length);
               tokenizer = new java.util.StringTokenizer(real,",");
               tokenNo = tokenizer.countTokens();
               data = new ArrayList();
               values = new String [tokenNo];
    //           Object[] arrayObject = data.toArray();// this is my initial code where arraylist is pass to object
                   for(int i =0; i< tokenNo; i++)   // pass string-ss into arraylist individually
                    data.add((tokenizer.nextToken(",")));
                    //values[i] = tokenizer.nextToken(",");
                    data.trimToSize();
                    //System.out.println("tokenizer"  + values);
    int aaaa = data.size();
    System.out.println("size " + aaaa);
    System.out.println("tokenizer" + tokenNo);
    System.out.println("arraylist "+ i + data.get(i));
    //JLIST
    //======== scrollPane1 ========
    //---- ManualList ---- This is my Jlist // copy arraylist into Object[] then pass it into JList
    listModel = new DefaultListModel();
    /* listModel = new DefaultListModel(); Part A also continue from above
    * for (int i = 0; i< arrayObject.length;i ++)
    * listModel.addElement(objectArray[i].toString());
    * JList ManualList = new JList(listModel); //tried using listModel.method() to remove item in Jlist but return nullException
    arrayObject = data.toArray();
    JList ManualList=new JList(arrayObject);
    ManualList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ManualList.setSelectedIndex(0);
    ManualList.setVisibleRowCount(5);
    ManualList.setFont(new Font("Times New Roman", Font.PLAIN,12));
    ManualList.setBorder(new MatteBorder(1, 1, 1, 1,Color.black));
    ManualList.setLayoutOrientation(JList.VERTICAL_WRAP);
    values = new String[tokenNo];
    ManualList.addListSelectionListener(new ValueReporter());
    // JScrollPane listPanel = new JScrollPane(ManualList);
    scrollPane1.setViewportView(ManualList);
    p.add(scrollPane1);
    scrollPane1.setBounds(210, 435, 130, 75);
    setVisible(true);
    { // compute preferred size
    Dimension preferredSize = new Dimension();
    for(int i = 0; i < p.getComponentCount(); i++) {
    Rectangle bounds = p.getComponent(i).getBounds();
    preferredSize.width = Math.max(bounds.x + bounds.width,preferredSize.width);
    preferredSize.height = Math.max(bounds.y +bounds.height, preferredSize.height);
    Insets insets = p.getInsets();
    preferredSize.width += insets.right;
    preferredSize.height += insets.bottom;
    p.setMinimumSize(preferredSize);
    p.setPreferredSize(preferredSize);
    private void addMouseClicked(MouseEvent e)
    private void deleteMouseClicked(MouseEvent e) //nthing happen here
    int n =ManualList.getSelectedIndex();
    if (!(n < 0) || (n > listModel.size()))
    listModel.removeElement(arrayObject[n]);
    delete.setEnabled(false);
    ManualList.repaint();
    ManualList.revalidate();
    /* int n =ManualList.getSelectedIndex(); //tried using this but failed
    if (!(n < 0) || (n > listModel.size()))
    listModel.remove(n);
    delete.setEnabled(false);
    ManualList.repaint();
    ManualList.revalidate();
    private void okButtonMouseClicked(MouseEvent e) {
    private void cancelButtonMouseClicked(MouseEvent e) {
    private class ValueReporter implements ListSelectionListener {
    public void valueChanged(ListSelectionEvent event) {
    // if (!event.getValueIsAdjusting())
    // gettext.setText(ManualList.getSelectedValue().toString());
    //String name=(String) ManualList.getSelectedValue();
    //System.out.println(name);
    private void ManualListMouseClicked(MouseEvent e) {
    // int n = (int)ManualList.getSelectedIndex();
    // if (!(n < 0) || (n > listModel.size()))
    // delete.setEnabled(true);
    ok this is a small complete program
    Thanks for the time to read this

  • Add item in JList

    How i can add each item to JList. Using loop not use array?

    I have not used a JList before, but looking at the API, one of the JLists constructors will take a Vector as one of it's argument
    JList API http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JList.html
    constructor
    JList(Vector listData) so you would be able to add elements to the vector in a loop using the add() method of the vector class
    then construct the JList after the elements have been added to the vector, this will mean that you do not have to specify the size of the vector (all thought you can) as it will dynamically grow as you add items to it.
    So if you don't know the amount of items that you will be adding to your JList to start with, it is a better bet than using an array
    again have a look at the vector API http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html
    hope that points you in the right direction
    JaVAmUG3380

  • Probelms Adding items to JList Component

    i tried to add items to JList from the database.... and it can add to the variable but the list isnt displaying....
    here is my code for that button...
    list_ListTopic = new JList(new DefaultListModel());
    DefaultListModel listModel = (DefaultListModel)list_ListTopic.getModel();
    jScrollPane1 = new JScrollPane(list_ListTopic);
    jScrollPane1.setViewportView(list_ListTopic);
    Vector data = new Vector();
    listModel.clear();
    while (lrs.next())
            data.add(lrs.getString("tName"));                                       
            i++;
    list_ListTopic.setListData(data);
    jScrollPane1.setViewportView(list_ListTopic);Thanks!

    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]How to Use Lists. It shows you how to initially load data into a list and then how to add/remove entries from the list. In general, you don't update the Vector after the ListModel has been created you update the model directly.

  • Two checkboxes to each item of JList

    I want to take two checkboxes to each item of Jlist
    and depending upon the checkbox state i want to add
    that item in a defferent Jlist

    You don't need any invisible nodes for that. Just create a class that can hold both the id and name, and which will return the name from the toString() method:
    public class Pair {
      private String id;
      private String name;
      public Pair(String i, String n) {
        id = i;
        name = n;
      public String getId() { return id; }
      public String getName() { return name; }
      public String toString() { return getName(); } // used by JTree to display the name
    }Of course, id and name can be other objects than Strings.

  • Can not add item to the shopping Cart with FireFox 8.0

    I can not add items to the shopping cart with Firefox 8.0. Switch to IE everything works then.

    Such details are stored in a cookie, so make sure that you do not block cookies on that site.
    *Tools > Page Info > Permissions
    You can inspect and manage the permissions for all domains on the <b>about:permissions</b> page via the location bar.
    *http://kb.mozillazine.org/Cookies
    *http://kb.mozillazine.org/Websites_report_cookies_are_disabled

  • How do I read txt file and add items to dropdownlist or checkbox

    I want to add items to a dropdown or check box by reading from a text file(and select one of them). (I donot use any table or database). The list of items is sometimes upto 20MB and hence cannot populate using session bean.I want items to be added to either checkbox or listbox during a button action. I have done this for textarea but unable so far to acheive for checkbox or listbox. I use following code which does not work:
    public String button3_action() {       
    try{           
    FileReader fr = new FileReader "F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s;
    while((s=br.readLine())!=null) {
    dropdown1.setValue(s);
    br.close();
    fr.close();
    }catch(Exception e) {
    e.printStackTrace();
    return null;
    I know I cant just transplant textarea code for dropdownlist or checkbox.
    Any help is greatly appreciated.
    Thanks.
    Dr.AM.Mohan Rao

    I am able to read from txt file to a listbox if i write in sessionsbean1:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1= s1+"\n";
    disOptions = new com.sun.rave.web.ui.model.Option[] {              
    new Option(s1,s1)};
    diseases = new String[] {};
    fr.close();
    br.close();
    catch(Exception e) {
    e.printStackTrace();
    But I get all data in one line!! if I click submit button text area gets all. How to display items in each line????Please help...
    Dr.AM. Mohan Rao

  • When I want to add items to the bookmarks toolbar, for example: -Zoom toolbar. The zoom Toolbar appears on the bookmarks toolbar, but it shows the favicons aswell the underlined text. I only want the favicons. How to do this, please help!!

    I want to add items to the bookmarks toolbar. for example: the Zoom Toolbar addon. This works, but not only the favicons appear on the bookmarks toolbar, aswell as the underlined text. How to avoid this?
    I only want the favicons from an addon to appear on the bookmarks toolbar, not with the underlined text. How to do this?
    This problem doesn't happen with any other toolbar. And this problem didn't happen with an earlier version of firefox. Please Help!
    Thanx, BassMann.

    If you only want the favicons and not the names of the bookmarks on the bookmarks toolbar, you can do that with the [https://addons.mozilla.org/en-US/firefox/addon/4072/ Smart Bookmarks Bar] add-on.

  • Get previous items unique value in new add item form

    Hi
    I have on list having items related to multiple locations.
    Every location is related to one user.
    When user logs in it filters the list with that users location.
    Now when user click on add new item I want to get the data related to his location using item event listener.
    But in new item form there is no way to get the location of that user in event listener as its new item.
    So I passed the qury string parameter form list and changed the add item form link and form to get the query string paramter as default value in Add new Item form.
    But again when user clicks on save button it redirects to original url without paramter. 
    How to redirect user to url with parameter on click on Save/Cancel.
    Is there any other way to get the previous item unique value in add new item from before executing the event listener?

    Hi,
    According to your post, my understanding is that you wanted to redirect user to url with parameter on click on Save/Cancel.
    You need to modify the onclick event need to as below:
    javascript: {{ddwrt:GenFireServerEvent('__redirect={{Home.aspx?Participant={@Participant}&amp;@Activity={@Activity}}}')}}
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b506cfe5-650e-4017-b470-9ca0a75cd390/sharepoint-2010-list-how-to-pass-parameters-in-a-url-to-another-page?forum=sharepointcustomizationprevious
    In addition, you can creating an intermediate page which just finds the filed value with a DVWP and then redirect to RedirectURL with the filed value on the Query String.
    For more information, you can refer to:
    Redirect to Another Page from NewForm.aspx with the New Item’s ID
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • DataGrid - Create at runtime - How to Add Items??

    I create a DataGrid at runtime and then and columns to it as need be. How Can I add items with the correct dataField if I don't if I don;t know this till runtime? In other word I'm having trouble constructing the Object to send to AddItem becase the dataField Name needs to be hard coded...
    Below does not work for me because if I have more than one column then I can seem to figure out out to create  ItemObjFinal dynnamically.
    var ItemObjFinal:Object = {ThisNameNeedsToBeDynamic: "text", ThisNameNeedsToBeDynamic: "value" };
    I also tried creating an array of Objects like this:
    var ItemObjFinal:Object = new Object;
    var obj:Object= dgc.dataField;
    ItemObjFinal [0] = {(obj.valueOf()):  dgc.headerText };
    ItemObjFinal [1] = {(obj.valueOf()):  dgc.headerText };
    =========================================================================================
                  ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var obj:Object= dgc.dataField;
                  var ItemObjFinal:Object = {(obj.valueOf()):  dgc.headerText };
                  var obj2:Object= dgc.dataField;
                  var ItemObjFinal2:Object = {(obj2.valueOf()): dgc.headerText};
                  //K Now add it!
                  //IList(dataGrid_preview.dataProvider).removeAll();
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                 //IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);

    Ahh answered my own question:
                 ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var ItemObjFinal:Object = new Object;
                  var ItemObjFinal2:Object = new Object;
                  for each(var col:DataGridColumn in ac)
                    ItemObjFinal[col.dataField] = col.headerText;
                    ItemObjFinal2[col.dataField] = col.headerText;
                  ItemObjFinal[dgc.dataField] = dgc.headerText;
                  ItemObjFinal2[dgc.dataField] = dgc.headerText;
                  //K Now add it!
                  if(IList(dataGrid_preview.dataProvider).length > 1)
                      IList(dataGrid_preview.dataProvider).removeItemAt(0);
                      IList(dataGrid_preview.dataProvider).removeItemAt(1);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);
    This code may still need some tweaking as I get an RTE at  "IList(dataGrid_preview.dataProvider).removeItemAt(1);"   but at least I'm able to solve my original question. Thanks Alex!

  • Cannot add item in A/P Invoice

    Hi, all,
    I want create a A/P invoice without copy from PO or GRPO. However, after I input BP Code, I am not able to add item in Matrix row. Seems that it is blocked
    Any ideas?
    Thanks

    Hello kimmycheng,
    The marketing document can be of 2 types ..Item or Service...this is indicated by the Item / Service type drop down just above the matrix/grid
    If you want to add an Item..this drop down should be set to Item.  If it is of type Service then you might not see the ItemCode column.
    If does not reflect / help what you are referring to ....then please explain your issue ina bit more detail
    Suda

  • Error message when trying to add item in change BOM goup

    Hi I went to transaction cs05,and trying to add item to specific material with BOM group,an error message popped up and saying assign the item to an alternative,what does it mean? How to solve?

    Hi,
    A finished material can have multiple alternative BOMS which can be stored in a common BOM group number. CS05 is used to change these multiple boms.
    When you add a new item in CS05, system will ask - to which alternative bom the new item should be assigned and that's how you are getting this message. For example, if in a bom group you have 3 differnet alternatvie boms for a FG material, when you add new item in CS05, you will see 3 checkbox at the right hand side of the screen. If you want to assign new item to all the three alternative BOMs , than select all the three check box and save.
    Regards,
    Ravi Thakkar.

  • Open Add Item Form as Dialog

    Hi All - I have a custom button on the click of which I am trying to open a Add Item form. When the display form opens I want to hide all the masterpage items( viz. Quick Launch, header, foooter, etc). I tried below but it's not opening and giving error
    when the masterpage is Oslo. It works fine when masterpage is Seattle. 
    <asp:LinkButton OnClientClick ="javascript:SP.UI.ModalDialog.showModalDialog({ url: '../Lists/AddAccount/NewForm.aspx', title: 'Add Account' }); return false;" CausesValidation="false"   CssClass="orange-btn" Text="Post"
    runat="server" ID="btnPost"></asp:LinkButton>
    Does anything know why is it happening?
    Regards,
    Khushi
    Khushi

    You need to set the URL of SharePoint link button like this
    http://<Site Name>/Lists/AddAccount/NewForm.aspx?isDlg=1
    to open that in modal dialog use below jScript.
    <script type="text/javascript">
    function openDialog(listUrl, frmTitle) {
    var options = {
    url: listUrl,
    title: frmTitle,
    allowMaximize: false,
    height: 500,
    width: 600,
    showClose: true
    //SP.UI.ModalDialog.showModalDialog(options);
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
    </script>
    And your anchor tag should be like
    <asp:LinkButton OnClientClick ="javascript:openDialog('/Lists/<List Name>/NewForm.aspx?IsDlg=1', 'Add Account')" CausesValidation="false" CssClass="orange-btn" Text="Post" runat="server" ID="btnPost"></asp:LinkButton>
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • How to customize the default add item in a content area

    Hi!! I want to know what can I do to introduce a file in a content area, but I don't want to use the default page that portal use. I want to customize the add item option, the same that I have done with the folders. The problem that I have is that I need the user to have the file on his/her pc, and the api add_item needs the file on unix, where de DB is installed.
    If anyone has any idea, please help me.

    Hi All,
    Thanks for all your reply, but maybe i didn't describe my problem clear. My problem for the combobox is that once the combobox has a selected value, then there is no way to clear it in the UI even I remove all the items in its ValidValues. From the user interface, the selected value still stays there but actually this combobox is empty and does not have any items. My question is how can I remove the current selected item in the combobox.
    Thanks,
    Lan

  • ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO

    I WANT TO ADD ITEMS  THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
    AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
    SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
    PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
    INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORM

    Hi Praveen,
    Your form is not shared so I have not been able to access it.  But I have updated mine.  There are now two approaches, one that follows on from the above method and updates each drop down list in each row.  The second updates a separate dataset that the drop down list is bound to.  This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain.  The add button click code is;
    var particulars = xfa.datasets.resolveNode("particulars");
    if (particulars === null)
        particulars = xfa.datasets.createNode("dataGroup","particulars");
        xfa.datasets.nodes.append(particulars);    
    var particular = xfa.datasets.createNode("dataValue","particular");
    particular.value = ItemName.rawValue;
    var boundValue = xfa.datasets.createNode("dataValue","id");
    boundValue.value = BoundValue.rawValue;
    particular.nodes.append(boundValue);
    boundValue.contains = "metaData";
    // find sorted position to insert
    for (var i = 0; i < particulars.nodes.length; i++)
        p = particulars.nodes.item(i);
        if (p.value > particular.value)
          particulars.nodes.insert(particular, p);       
                 break;
    // add to end if greater than all existing items
    if (particular.parent === null)
        particulars.nodes.append(particular);
    // clear source fields
    ItemName.rawValue = null;
    BoundValue.rawValue = null;
    // remerge form data to pick up new item
    xfa.form.remerge();
    And the binding looks like;
    I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
    Regards
    Bruce

Maybe you are looking for

  • I would like to know why i have to pay a service fee even if my IPOD 4 gen is within the warranty period

    My Ipod touch screen get White there fore i brought it to the premium retailer where i bought it. after 15 days with no anwser of the retailer, i moved to the shop to have more information. they told me that my ipod could not be repaire and i had to

  • Unable to create the infotype

    Hi SAP Guru, Greetings for the day, I had hired a guy with the infotype of  0207,0208,0209,0210 after hiring i try to transfer him using TRANSFER ACTION to another location say from New York to California, which is entirely a different state, where u

  • Can't create relfow project in photoshop

    edge relfow & adobe photoshop CC are not connecting with each other and all plugins are up to date.

  • Selecting via multiple tables

    Hello, I need to calculate a list of people, who got some services more that 2 times with the same service koda (pas_kodas) to the same person (zmo_kodas). It should not depend on report number. http://www.gentoo.lt/sql.jpg What I get is in green (se

  • ACCESS-KEY (add developer)

    Hello! I have installed Netweaver testdrive for Suse Linux for teach myself in ABAP-Programming. After starting TA SA38 and trying to generate the program Z_HELLO i get a input prompt where i should type the access-key. Is it really necessary to regi