Unable to set panel  using set method.

Dear friends,
I declared a class called EntryPanel in which I declared and initialized the emty panel which I later want to override with new Panel in Child classes. Now I declared an internal frame where I initialized this Panel and later I extended it by Material internal frame in this class I want to override the panel I created in EntryPanel using set but I am unable to do that I am posting the code below. I hope someone would have faced similar problem
I have created classes as below.
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.GridBagConstraints;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import javax.swing.border.EtchedBorder;
import noptics.client.lens.gui.AddCancelBtnPanel;
public class EntryPanel extends javax.swing.JPanel {
     private AddCancelBtnPanel btnPanel;
     private JPanel fieldPanel;
     public EntryPanel() {
          initGUI();
     * Initializes the GUI.
     public void initGUI(){
          try {
               fieldPanel = new JPanel();
               btnPanel = new AddCancelBtnPanel();
               GridBagLayout thisLayout = new GridBagLayout();
               this.setLayout(thisLayout);
               fieldPanel.setBorder(new EtchedBorder(BevelBorder.LOWERED, null, null));
               GridBagConstraints c = new GridBagConstraints();
               c.gridx = 0;
               c.gridy = 0;
               c.gridwidth = 1;
               c.gridheight = 1;
               c.weightx = 1.0;
               c.weighty = 1.0;
               c.anchor = GridBagConstraints.NORTH;
               c.fill = GridBagConstraints.BOTH;
               c.insets = new Insets(5, 5, 5, 5);
               c.ipadx = 0;
               c.ipady = 0;
               this.add(fieldPanel, c);
               c.gridy = 1;
               c.weightx = 0.0;
               c.weighty = 0.0;
               c.anchor = GridBagConstraints.NORTH;
               c.fill = GridBagConstraints.HORIZONTAL;
               c.insets = new Insets(0, 0, 5, 0);
               this.add(btnPanel, c);
          } catch (Exception e) {
               e.printStackTrace();
      * @return <code>AddCancelBtnPanel</code> -
      * This can be used to get reference to button panel. 
     public AddCancelBtnPanel getBtnPanel() {
          return btnPanel;
      * @return <code>JPanel</code> - Reference to fieldPanel;
     public JPanel getFieldPanel() {
          return fieldPanel;
      * @param <code>JPanel</code> - panel Replace with orignal Panel
      * with fields.
     public void setFieldPanel(JPanel panel) {
          fieldPanel = panel;
import javax.swing.JSplitPane;
import noptics.client.lens.gui.EntryPanel;
import noptics.client.lens.gui.ListPanel;
public class ListEntryInternalFrame extends javax.swing.JInternalFrame {
     private EntryPanel entryPanel;
     private ListPanel listPanel;
     private JSplitPane listEntrySplitPane;
      * @param string
     public ListEntryInternalFrame(String string) {
          super(string);
          initGUI();
     public ListEntryInternalFrame() {
          this("");
     * Initializes the GUI.
     public void initGUI(){
          try {
               listEntrySplitPane = new JSplitPane();
               listPanel = new ListPanel();
               entryPanel = new EntryPanel();
               this.setResizable(true);
               this.setClosable(true);
               this.setMaximizable(true);
               this.setToolTipText("Default List Entry Screen");
               this.setPreferredSize(new java.awt.Dimension(400,200));
               this.setAutoscrolls(true);
               listEntrySplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
               listEntrySplitPane.setOneTouchExpandable(true);
               this.getContentPane().add(listEntrySplitPane);
               listEntrySplitPane.add(listPanel, JSplitPane.RIGHT);     
               listEntrySplitPane.add(entryPanel, JSplitPane.LEFT);
          } catch (Exception e) {
               e.printStackTrace();
      * @return
     public EntryPanel getEntryPanel() {
          return entryPanel;
      * @return
     public JSplitPane getListEntrySplitPane() {
          return listEntrySplitPane;
      * @return
     public ListPanel getListPanel() {
          return listPanel;
public class MaterialInternalFrame extends ListEntryInternalFrame {
     MaterialPanel material;
      * Default Constructor
     public MaterialInternalFrame() {
          this("Material Entry Screen");          
      * @param <code>String</code> - string
     public MaterialInternalFrame(String string) {
          super(string);
     public void postInitGUI() {
          material = new MaterialPanel();
          super.getEntryPanel().getFieldPanel().add(material);          
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.GridBagConstraints;
import javax.swing.JLabel;
import javax.swing.JTextField;
* This panel contains entry field for Material.
public class MaterialPanel extends javax.swing.JPanel {
     private JTextField nameTxt;
     private JLabel fieldLbl;
     private JLabel titleLbl;
     public MaterialPanel() {
          initGUI();
     * Initializes the GUI.
     public void initGUI(){
          try {
               titleLbl = new JLabel();
               fieldLbl = new JLabel();
               nameTxt = new JTextField();
               GridBagLayout thisLayout = new GridBagLayout();
               this.setLayout(thisLayout);
               thisLayout.columnWidths = new int[] {1,1};
               thisLayout.rowHeights = new int[] {1,1};
               thisLayout.columnWeights = new double[] {0.1,0.1};
               thisLayout.rowWeights = new double[] {0.1,0.1};
               // this.setPreferredSize(new java.awt.Dimension(200,100));
               titleLbl.setText("Material");
               GridBagConstraints c = new GridBagConstraints();
               c.gridx = 0;
               c.gridy = 0;
               c.gridwidth = 2;
               c.gridheight = 1;
               c.weightx = 0.0;
               c.weighty = 0.0;
               c.anchor = GridBagConstraints.NORTH;
               c.fill = GridBagConstraints.NONE;
               c.insets = new Insets(5, 0, 5, 0);
               c.ipadx = 0;
               c.ipady = 0;
               this.add(titleLbl, c);
               fieldLbl.setText("Name:");
               c.gridy = 1;
               c.gridwidth = 1;
               c.anchor = GridBagConstraints.NORTHEAST;
               c.insets = new Insets(0, 0, 0, Constants.RIGHTGAP);
               this.add(fieldLbl, c);
               nameTxt.setColumns(20);
               nameTxt.setText("Material Name");
               nameTxt.setText("Material Name");               
               nameTxt.setMaximumSize(new java.awt.Dimension(100,40));
               nameTxt.setMinimumSize(Constants.txtDimension);
               nameTxt.setPreferredSize(Constants.txtDimension);
               c.gridx = 1;
               c.gridheight = 1;
               c.weightx = 1.0;
               c.weighty = 1.0;
               c.anchor = GridBagConstraints.NORTHWEST;
               c.insets = new Insets(0, 0, 0, 0);
               this.add(nameTxt, c);
          } catch (Exception e) {
               e.printStackTrace();
}

Sorry, this is just a quick response...i haven't
really read your code too thoroughly.
You could try calling
super.getEntryPanel().validate(); after setting the
field panel
or super.getEntryPanel().updateUI();I have tried both but it doesn't work
when I change my postInitGUI function code as given below I am able to see the Label but the new panel I want to set is not getting set. I can add material panel in old panel but I am unable to reset that panel with new Panel.
// Function postInitGUI in MaterialInternalFrame class
public void postInitGUI() {
     super.getEntryPanel().getFieldPanel().add(new JLabel("Hello World"));
     material = new MaterialPanel();
     super.getEntryPanel().setFieldPanel(material);
}

Similar Messages

  • Unable to set session in Oracle Portal useing reverse proxy

    I have deployed a reverse proxy (using Oracle HTTP Server) in front of a Oracle Portal Install (version 10.1.2.0.2). The steps followed to set this up came from the following documents:
    Steps mentioned in Section 9.2 Configuring a Reverse Proxy for OracleAS Portal and OracleAS Single Sign-On for a reverse proxy on a Oracle HTTP Server.
    http://download-west.oracle.com/docs/cd/B14099_15/core.1012/b13998/variants.htm#ASTED005
    Also performed steps mentioned in -> Section 5.3.7 - Step 7: Enable Session Binding on OracleAS Web Cache of the Oracle® Application Server Portal Configuration Guide 10g Release 2 (10.1.2) -- B14037-03.
    My current (example names shown only)setup details are as follows:
    Reverse Proxy for SSO server (running on internal.oracle.com:7777): proxy.oracle.com:7777
    Reverse Proxy for Portal server (running on internal.oracle.com:7778): proxy.oracle.com:7778
    With the above steps completed, I can successfully use the http://proxy.oracle.com:7777/pls/orasso for login into SSO without any issues.
    Users get authenticated successfully.
    I can also use http://proxy.oracle.com:7778/pls/portal for viewing pages on the portal fine . All self referencing links have also been successfully modified to point to proxy.oracle.com:7778.
    However, an attempt to login in the portal is not successful. Clicking on the 'Login' link successfully redirects to the SSO login page (http://proxy.oracle.com:7777/<login-page>). However, after successful authentication, the success page fails to show up and the user gets shown the initial login portal home page again.
    There are no error messages shown on the screen.But it seems that user session is failing to be initiated/set correctly, as shown by the log file (in $PORTAL_ORACLE_HOME/j2ee/OC4J_Portal/application-deployments/portal/OC4J_Portal_default_island_1/application.log ):
    06/11/21 16:49:31 portal: [module=RepositoryServlet, ecid=83928411196,1] Repository Gateway: LWUser: PUBLIC, Cookie: oracle.uix=0^^GMT+10:00;
    portal=9.0.3+en-au+us+AUSTRALIA+22BC75924EEAD8A2E040007F010019F7+8DAC5E3559C95F5E0090A6F56FFA58192CB0F437CA57A9102A6394F1EB7FAB5DEE3BFA12C65
    91C0C009B6......
    06/11/21 16:49:31 portal: [module=RepositoryServlet, ecid=83928411196,1] ERROR: Repository Gateway error: Database Error: ORA=20001 ORA-20001:
    Unable to obtain session information from the cookie. Please close your browser and reconnect.
    ORA-06512: at "PORTAL.WPG_SESSION", line 149
    ORA-06512: at line 22
    Any help with this will be appreciated.
    Thanks.

    Hi Chris,
    The begin of the expection stack gives you the reason:
    06/11/03 09:13:59 java.sql.SQLException: The method 'setSavepoint' cant be called when a global transaction is active
    The reason is, that either the whole global transaction must be commited or rollbacked.
    I don't know your actual configuration, but between the methods begin() and commit()/rollback() of the UserTransaction instance, OC4J/OracleAS uses a global transaction (= XA transaction) in your configuration. The state of a global transactions is completely under the control of the application server and several restrictions must be considered. One of them is, that you can't use the method setSavePoint/. E.g. you can't also call the method setAutoCommit(true) in this state, or change the transaction isolation level via setTransactionIsolation(newLevel).
    This is NOT a limitation of the OC4J/OracleAS but is true for ALL application servers.
    P.S. I can successfully set savepoints and rollback to savepoints in weblogic 9.0This means, that WebLogic 9.0 doesn't use a global transaction in this case.
    Because I don't know your configurations (Oracle and WebLogic) I can't say, why the behave different in this situation.
    Best,
    Manfred

  • Unable to find setter method for attribute:

    I am using Jboss jboss-4.2.3.GA, JDK 1.6.
    I am trying to deploy our application on Jboss. When loading sources page or whenever we try to load the taglib we are getting the following error.
    org.apache.jasper.JasperException: jspfile.jsp(67,1) Unable to find setter method for attribute: collection
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2736)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2965)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2169)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1689)
    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2388)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2394)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
    at org.apache.jasper.compiler.Generator.generate(Generator.java:3374)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
    at com.ssmb.common.servlets.GenericControllerServlet.service(GenericControllerServlet.java:639)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:619)
    The line corresponding in JSP file is ,
    <ssmb:list name="src_" collection="sources" showAll='<%= "" + true %>'>
    Please let me know if you have faced this issue before.

    Have you written this tag in a tld or a tag file?
    How have you declared the attribute "collection"?
    Does the class which implements the custom tag <ssmb:list> have a method in it: public void setCollection(String collection) ?

  • Unable to set kernel parameters using Reource Control

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx
    guru

    I finally had some time to find the actual syntax for tuning process.max-msq-qbytes and process.max-msg-messages. prctl will change those paramaters for an existing process.
    As a proof of concept I changed process.max-msg-messages to a 64k. process 2221 is my shell.
    prctl -n process.max-msg-messages  -r -v 64k 2221
    bash-3.00# prctl 2221
    process: 2221: -csh
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    process.max-port-events
            privileged      65.5K       -   deny                                 -
            system          2.15G     max   deny                                 -
    process.max-msg-messages
            privileged      64.0K       -   deny                                 -
            system          4.29G     max   deny                                 -
    process.max-msg-qbytes
            privileged      64.0KB      -   deny                                 -
            system          4.00GB    max   deny                                 -And now to make this persist across reboots...
    So long as I'm experimenting, I'll use projadd and add a new project which just includes me and not the rest of the users in the group staff.
    bash-3.00# projadd -p 115 -U testuser \
    -K "process.max-msg-messages=(priv,64K,deny)" \
    -K "process.max-msg-qbytes=(priv,64K,deny)" \
    user.me This creates the following /etc/project:
    (note the last line is all on one line in the real file minus the \.)
    placer% cat /etc/project
    system:0::::
    user.root:1::::
    noproject:2::::
    default:3::::
    group.staff:10::::
    user.me:115::testme::\
    process.max-msg-messages=(priv,64000,deny);process.max-msg-qbytes=(priv,65536,deny)After a reboot I checked the values by loging in under my user and running prctl.
    placer% prctl $$
    process: 419: -csh
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    process.max-port-events
            privileged      65.5K       -   deny                                 -
            system          2.15G     max   deny                                 -
    process.max-msg-messages
            privileged      64.0K       -   deny                                 -
            system          4.29G     max   deny                                 -
    process.max-msg-qbytes
            privileged      64.0KB      -   deny                                 -
            system          4.00GB    max   deny                                 -
    process.max-sem-ops
            privileged        512       -   deny                                 -
            system          2.15G     max   deny                                 -
    ...Solaris 10 has different tunables and default values from 8 and 9. It's default tunables should be good for most applications per a given system's hardware. There are some great blog articles, and discussions on opensolaris.org and blogs.sun.com on tuning that explain the intent of tuning and why we shouldn't have to tune.
    Cheers,
    ~~sa

  • Setting value for attribute  'PO_NUMBER_SOLD'  using setter method

    Hi Experts,
    I need to set the value of a screen field according to some condition. I am using setter method of this attribute to set the value but it is not getting changed.
    I have written following code in DO_PREPARE_OUTPUT method of implementation class ZL_ZZBT131I_ZCREDITCHECK_IMPL using setter method of attribute
    Get Referral Authorization Code
          lv_val1 = me->typed_context->crechkresph->get_po_number( attribute_path = 'PO_NUMBER' ).
          me->typed_context->crechkresph->set_po_number( attribute_path = 'PO_NUMBER'
                                                            value     = ' ' ).
    while debugging I found that in method set_po_number set_property method has been used:--
    current->set_property(
                          iv_attr_name = 'PO_NUMBER_SOLD' "#EC NOTEXT
                          iv_value     = <nval> ).
    In set_property method  following code is getting executed
    if ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY.
              if <VALUE> ne IV_VALUE.
                if ME->MY_MANAGER_ENTRY->DELTA_FLAG is initial.
                first 'change' -> proof that entity is locked
                  if ME->MY_MANAGER_ENTRY->LOCKED = FALSE.
                    if ME->LOCK( ) = FALSE.
                      return.
                    endif.
                  endif.
                flag entity as modified
                  ME->MY_MANAGER_ENTRY->DELTA_FLAG = IF_GENIL_CONTAINER_OBJECT=>DELTA_CHANGED.
                endif.
                ME->ACTIVATE_SENDING( ).
              change value
                <VALUE> = IV_VALUE.
              log change
                set bit LV_IDX of ME->CHANGE_LOG->* to INDICATOR_SET.
              endif.
            else.
            check if it is a real read-only field or a display mode violation
              assert id BOL_ASSERTS subkey 'READ-ONLY_VIOLATION'
                     fields ME->MY_INSTANCE_KEY->OBJECT_NAME
                            IV_ATTR_NAME
                     condition ME->CHANGEABLE = ABAP_TRUE.
            endif.
    and in debugging I found that if part ( ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY) fails and hence else part is getting executed and hence my field a real read-only field or a display mode violation is happening according to comments in code.
    What shall I do so that I would be able to change the screen field value?
    Any help would be highly appreciated.
    Regards,
    Vimal

    Hi,
    Try this:
    data: lr_entity type cl_crm_bol_entity.
    lr_entity = me->typed_context->crechkresph->collection_wrapper->get_current( ).
    lr_entity->set_property( iv_attr_name = 'PO_NUMBER' value = '').
    Also, make sure the field is not read-only.
    Regards
    Prasenjit

  • Unable to open windows using boot camp.  Get message "The bless tool was unable to set the current boot disk."  Any thoughts, Thank you.

    Unable to open windows using boot camp.  Get message "The bless tool was unable to set the current boot disk."   I am using an Imac , Lion operating system, and Windows 7.  It worked a few days ago.  Any thoughts, Thank you.

    Note that nowhere in the Boot Camp instructions does it tell you to use Disk Utility to format the Windows partition. The Boot Camp Assistant program creates the partition & sets the +partition scheme info+ of the disk as appropriate for the Windows installer but the Windows installer itself is responsible for formatting the new partition with the appropriate +file system scheme+ (NTFS for Windows 7).
    If you follow the instructions in the Boot Camp Installation & Setup Guide to the letter you should have no problems installing Windows.

  • Getter/setter methods -- how do I use the return values

    I'm just learning Java, and I haven't been to this site since the end of July, I think. I have a question regarding getter and setter methods. I switched to the book Head First Java after a poster here recommended it. I'm only about a hundred pages into the book, so the code I'm submitting here reflects that. It's the beginnings of a program I'd eventually like to complete that will take the entered information of my CD's and alphabetize them according to whatever criteria I (or any user for that matter) choose. I realize that this is just the very beginning, and I don't expect to have the complete program completed any time soon -- it's my long term goal, but I thought I could take what I'm learning in the book and put it to practical use as I go along (or at lest try to).
    Yes I could have this already done it Excel, but where's the fun and challenge in that? :) Here's the code:
    // This program allows the user to enter CD information - Artist name, album title, and year of release -- and then organizes it according the the user's choice according to the user's criteria -- either by artist name, then title, then year of release, or by any other order according to the user's choice.
    //First, the class CDList is created, along with the necessary variables.
    class CDList{
         private String artistName;//only one string for the artist name -- including spaces.
         private String albumTitle;//only one string the title name -- including spaces.
         private int yearOfRelease;
         private String recordLabel;
         public void setArtistName(String artist){
         artistName = artist;
         public void setAlbumTitle(String album){
         albumTitle = album;
         public void setYearOfRelease(int yor){
         yearOfRelease = yor;
         public void setLabel(String label){
         recordLabel = label;
         public String getArtistName(){
         return artistName;
         public String getAlbumTitle(){
         return albumTitle;
         public int getYearOfRelease(){
         return yearOfRelease;
        public String getLabel(){
        return recordLabel;
    void printout () {
           System.out.println ("Artist Name: " + getArtistName());
           System.out.println ("Album Title: " + getAlbumTitle());
           System.out.println ("Year of Release: " + getYearOfRelease());
           System.out.println ("Record Label: " + getLabel());
           System.out.println ();
    import static java.lang.System.out;
    import java.util.Scanner;
    class CDListTestDrive {
         public static void main( String[] args ) {
              Scanner s=new Scanner(System.in);
              CDList[] Record = new CDList[4];
              int x=0;     
              while (x<4) {
              Record[x]=new CDList();
              out.println ("Artist Name: ");
              String artist = s.nextLine();
              Record[x].setArtistName(artist);
              out.println ("Album Title: ");
              String album = s.nextLine();
              Record[x].setAlbumTitle(album);
              out.println ("Year of Release: ");
              int yor= s.nextInt();
                    s.nextLine();
              Record[x].setYearOfRelease(yor);
              out.println ("Record Label: ");
              String label = s.nextLine();
              Record[x].setLabel(label);
              System.out.println();
              x=x+1;//moves to next CDList object;
              x=0;
              while (x<4) {
              Record[x].getArtistName();
              Record[x].getAlbumTitle();
              Record[x].getYearOfRelease();
              Record[x].getLabel();
              Record[x].printout();
              x=x+1;
                   out.println("Enter a Record Number: ");
                   x=s.nextInt();
                   x=x-1;
                   Record[x].getArtistName();
                Record[x].getAlbumTitle();
                Record[x].getYearOfRelease();
                Record[x].getLabel();
                Record[x].printout();
         }//end main
    }//end class          First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.
    Edited by: Straitsfan on Sep 29, 2009 2:03 PM

    Straitsfan wrote:
    First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.Yes, there is tons you could have done more efficiently. But this is something every new programmer goes through, and I will not spoil the fun. You see, in 3 to 6 months when you have learned much more Java, assuming you stick with it, you will look back at this and be like "what the hell was I thinking" and then realize just haw far you have come. So enjoy that moment and don't spoil it now by asking for what could have been better/ more efficient. If it works it works, just be happy it works.
    Straitsfan wrote:
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.First, if you posted this somewhere else you should link to that post, it is good you at least said you did, but doubleposting is considered very rude because what inevitably happens in many cases is the responses are weighed against each other. So you are basically setting anyone up who responds to the post for a trap that could make them look bad when you double post.
    You are setting you getters and setters up right as far as I can tell. Which tells me that I think you grasp that a getter lets another class get the variables data, and a setter lets another class set the data. One thing, be sure to use the full variable name so you should have setRecordLabel() and getRecodLabel() as opposed to setLabel() and getLabel(). Think about what happens if you go back and add a label field to the CDList class, bad things the way you have it currently. Sometimes shortcuts are not your friend.
    And yes, you are using the getters all wrong since you are not saving off what they return, frankly I am suprised it compiles. It works because you don't really need to use the getters where you have them since the CDList Record (should be lowercase R by the way) object already knows the data and uses it in the printout() method. Basically what you are doing in lines like:
    Record[x].getArtistName();is asking for the ArtistName in Record[x] and then getting the name and just dropping it on the floor. You need to store it in something if you want to keep it, like:
    String artistName = Record[x].getArtistName();See how that works?
    Hope this helped, keep up the good learning and good luck.
    JSG

  • When I try to use the internal hard drive as a scratch disk I get this error "unable to set scratch disk- the selected directory is on write protect or non-writable media.  Any ideas on how to fix this.  It only happens in fcp.

    When I try to use the internal hard drive as a scratch disk I get this error "unable to set scratch disk- the selected directory is on write protect or non-writable media.  Any ideas on how to fix this.  It only happens in fcp.

    By internal, I assume you're referring to your systems (boot) drive. Is it, by chance, a partitioned dive?
    Also…although many people successfully use their systems drives as scratch disks, over time you'll have better results using a dedicated drive for your media.
    Good luck.
    Russ

  • Pass as a parameter or use set() method?

    This question may be a bit too abstract:
    A method of ClassB needs the HashMap member variable 'map' from ClassA. Should I pass map as a parameter into a method of ClassB, i.e.
    ClassB b = new ClassB();
    b.aMethod(map);or should I use a set() method in ClassB to set a member variable of type HashMap in ClassB, i.e.
    ClassB b = new ClassB();
    b.setMap(map); //sets the HashMap member variable in ClassB to equal map
    b.aMethod(); //aMethod now performs its operation on the HashMap member variable of ClassBHow do you decide which way is prefereable?

    Depends on your model, I suppose. Form the example, though, I wouldn't make the map a member of Class B, unless Class B should logically possess such a map. If the method in Class B is just operating on some values from the map, it makes more sense to me just to pass it in as an argument.

  • When installing Adobe Captivate I get msg: unable to set-up control panel

    When installing Adobe Captivate I get msg: unable to set-up control panel..Does anyone know how to resolve?

    Hi,
    It seems that Captivate is not downloaded completely. Only one file is downloaded(i.e. .exe) , .7z file is missing.  You can follow the below instructions to download Captivate 7 via direct links.
    In order to download Adobe Captivate 7.0 Windows English, open the link mentioned below and sign in with your Adobe ID and password.
    https://www.adobe.com/cfusion/tdrc/index.cfm?product=captivate
    Once you sign In with your Adobe Id and password, you will be redirected to Adobe Captivate 7.0 download page, Do not click on download. Kindly stay on that page and paste the below two links on the Trail Page Address Bar  one by one and save the files on your system at same location:
    http://trials3.adobe.com/AdobeProducts/CPTV/7/win32/Captivate_7_LS21.7z
    http://trials3.adobe.com/AdobeProducts/CPTV/7/win32/Captivate_7_LS21.exe
    When both the files finish downloading, then run the second file (.exe) which will start extracting the first file (.7z) and will start installing Adobe Captivate 7.0 on your computer.
    Regards,
    Mayank

  • How to use set_encoding method to set encoding in ABAP Mapping

    Hi All,
      Can anyone please let me know how to use set_encoding method in ABAP Mapping to set encoding.
      Any help would be greatly appreciable.
    Regards,
    Dinakar

    Hi Stefan,
    Thanks for your info. Let me try in ABAP Forum.
    Regards,
    Dinakar

  • Custom tag - unable to find setter method error

    I see this compileException on IAS but not on BEA app server and iWS.
    JSPProvider.processJSPFile(): jsp=searchContent.jsp, org.apache.jasper.compiler.CompileException
    Unable to find setter method for attribute: input
    The reason is because the custom tag has a setInput() that takes a String parameter while the getInput() returns an InputStream.
    Should both get and set methods have the same type of parameters or is this a due to a bug in the app server ?

    I see this compileException on IAS but not on BEA app
    server and iWS.
    JSPProvider.processJSPFile(): jsp=searchContent.jsp,
    org.apache.jasper.compiler.CompileException
    Unable to find setter method for attribute: input
    The reason is because the custom tag has a setInput()
    that takes a String parameter while the getInput()
    returns an InputStream.
    Should both get and set methods have the same type of
    parameters or is this a due to a bug in the app server
    I was only going off info from the original post. The error specifically states "Unable to find setter method for attribute: input" with a lower case i for the input attribute. You also specifcally stated "The reason is because the custom tag has a setInput()" with a capital I for the setInput method. This would most definitely cause the error you were receiving. That is unless you corrected this between your original post and your followup testing.
    Cliff

  • Unable to set mailbox forwarder within ECP using Internet Explorer

    We seem to have an issue that has developed where using Internet Explorer we are now unable to set a mailbox forwarder within the ECP.
    When we use Internet Explorer 11 the following is used to discover the issue:
    1. Under mailboxes select any recipient, click "mailbox features" > and under Mail Flow click "View details"
    2. Click "Enable forwarding" > "Browse" and then select and recipient you want to forward ail too.
    3. Once you click on "Ok" it will be observed that the field in IE is blank account to forward to is not there.
    We have tried rebooting the CAS already in case something was cached but this did not help resolve the issue.
    We have noticed that if you open the ECP and repeat the steps in Firefox or Chrome the issue is not there. This is happening on all our machines in the domain and says to me it is an IE issue rather than Exchange maybe.. Does anyone know what might be causing
    it?
    Our environment is Windows Server 2012 R2, Exchange 2013 CU6

    Hi,
    After installing update 3008923, some web application modal dialog boxes may not work correctly in Internet Explorer 11. Now there is an update to resolve this issue.
    For your reference:
    Some web application modal dialog boxes don't work correctly in Internet Explorer 11 after you install update 3008923
    https://support.microsoft.com/kb/3025390
    Hope this can be helpful to you.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact 
    [email protected]
    Amy Wang
    TechNet Community Support

  • Cisco 881 integrated services router - I am unable to set up the device using the CCP New Device Setup Wizard.

    I am unable to set up the device - I get the following error:
    CCP encountered an error while executing the command :
    yourname#term len 0
    yourname#conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    yourname(config)#username ccpuser privilege 15 secret 0 ccppasswd
    yourname(config)#interface FastEthernet0
    yourname(config-if)#ip address 192.168.1.1 255.255.255.0
    % IP addresses may not be configured on L2 links.
    yourname(config-if)#no shutdown
    yourname(config-if)#exit
    yourname(config)#ip http server
    yourname(config)#ip http authentication local
    yourname(config)#ip http timeout-policy idle 60 life 86400 requests 10000
    yourname(config)#line vty 0 4
    yourname(config-line)#login local
    yourname(config-line)#transport input telnet
    yourname(config-line)#exit
    yourname(config)#line vty 5 15
    yourname(config-line)#login local
    yourname(config-line)#transport input telnet
    yourname(config-line)#exit
    yourname(config)#exit
    Fix these errors and retry.

    u cant give a ip to 2nd layer fast ethernet port.. this port is like a port of switch.
    if u want to give ip to that port.
    use that command .
    interface vlan 1
    ip address x.x.x.x x.x.x.x.
    no sh
    exit
    int fas 0
    switchport mode access
    switchport access vlan 1

  • Error NtpClient was unable to set a manual peer. DNS resolution error When using IP address.

    Hya,
    We have been migarting to some new DCs. one of the new DCs now has all the master roles call it DC01.
    when I try and sync/setup NTP on this server as the the authoritive NTP in the doamin I get:
    NtpClient was unable to set a manual peer to use as a time source because of DNS resolution error on '”10.*.*.*,0x1”'. NtpClient will try again in 15 minutes and double the reattempt interval thereafter. The error was: No such host is known. (0x80072AF9)
    I am using the following commands to set NTP up on the server.
    >net stop w32time
    >w32tm /config /syncfromflags:manual /manualpeerlist:"10.*.*.*,0x1"
    >w32tm /config /reliable:yes
    >net start w32time.
    Is anyone aware of what the issue could be?
    Ps one of the old dc can still sync to this site manually if tried.
    cheers Mike

    Hi,
    First make sure your DNS is working properly, then please try this article below:
    Event ID 134 — Manual Time Source Acquisition
    http://technet.microsoft.com/en-us/library/cc756393(v=ws.10).aspx
    Hope this helps.

  • Using OS7 I am unable to set up iCloud but was able to do so with the earlier OS

    I am using OS 7 on my iphone 4s and iPad 2 an am unable to set up icloud for the Find Me App. I am redirected to the icloud section of settings to sign in but there is no place to do so.

    Are you using mobile Safari on the iphone to log into icloud.com?  If so, you can't access icloud.com with mobile safari.
    As for icloud.  Check  Settings>icloud.  Are you logged into the right icloud account?  If so, on the same page, turn on Find My iPhone, if that's what you want to do.
    If what you mean is that the Find My iPhone app doesn't let you log into icloud, then you must not be using the right ID.

Maybe you are looking for