Problem with a template method in JDialog

Hi friends,
I'm experiencing a problem with JDialog. I have a base abstract class ChooseLocationDialog<E> to let a client choose a location for database. This is an abstract class with two abstract methods:
protected abstract E prepareLocation();
protected abstract JPanel prepareForm();Method prepareForm is used in the constructor of ChooseLocationDialog to get a JPanel and add it to content pane.
Method prepareLocation is used to prepare location of a database. I have to options - local file and networking.
There are two subclasses ChooseRemoteLocationDialog and ChooseLocalFileDialog.
When I start a local version, ChooseLocalFileDialog with one input field for local file, everything works fine and my local client version starts execution.
The problem arises when I start a network version of my client. Dialog appears and I can enter host and port into the input fields. But when I click Select, I get NullPointerException. During debugging I noticed that the values I entered into these fields ("localhost" for host and "10999" for port) were not set for corresponding JTextFields and when my code executes getText() method for these input fields it returns empty strings. This happens only for one of these dialogs - for the ChooseRemoteLocationDialog.
The code for ChooseLocationDialog class:
public abstract class ChooseLocationDialog<E> extends JDialog {
     private E databaseLocation;
     private static final long serialVersionUID = -1630416811077468527L;
     public ChooseLocationDialog() {
          setTitle("Choose database location");
          setAlwaysOnTop(true);
          setModal(true);
          Container container = getContentPane();
          JPanel mainPanel = new JPanel();
          //retrieving a form of a concrete implementation
          JPanel formPanel = prepareForm();
          mainPanel.add(formPanel, BorderLayout.CENTER);
          JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
          JButton okButton = new JButton(new SelectLocationAction());
          JButton cancelButton = new JButton(new CancelSelectAction());
          buttonPanel.add(okButton);
          buttonPanel.add(cancelButton);
          mainPanel.add(buttonPanel, BorderLayout.SOUTH);
          container.add(mainPanel);
          pack();
          Toolkit toolkit = Toolkit.getDefaultToolkit();
          Dimension screenSize = toolkit.getScreenSize();
          int x = (screenSize.width - getWidth()) / 2;
          int y = (screenSize.height - getHeight()) / 2;
          setLocation(x, y);
          addWindowListener(new WindowAdapter() {
               @Override
               public void windowClosing(WindowEvent e) {
                    super.windowClosing(e);
                    System.exit(0);
     public E getDatabaseLocation() {
            return databaseLocation;
     protected abstract E prepareLocation();
     protected abstract JPanel prepareForm();
      * Action for selecting location.
      * @author spyboost
     private class SelectLocationAction extends AbstractAction {
          private static final long serialVersionUID = 6242940810223013690L;
          public SelectLocationAction() {
               putValue(Action.NAME, "Select");
          @Override
          public void actionPerformed(ActionEvent e) {
               databaseLocation = prepareLocation();
               setVisible(false);
     private class CancelSelectAction extends AbstractAction {
          private static final long serialVersionUID = -1025433106273231228L;
          public CancelSelectAction() {
               putValue(Action.NAME, "Cancel");
          @Override
          public void actionPerformed(ActionEvent e) {
               System.exit(0);
}Code for ChooseLocalFileDialog
public class ChooseLocalFileDialog extends ChooseLocationDialog<String> {
     private JTextField fileTextField;
     private static final long serialVersionUID = 2232230394481975840L;
     @Override
     protected JPanel prepareForm() {
          JPanel panel = new JPanel();
          panel.add(new JLabel("File"));
          fileTextField = new JTextField(15);
          panel.add(fileTextField);
          return panel;
     @Override
     protected String prepareLocation() {
          String location = fileTextField.getText();
          return location;
}Code for ChooseRemoteLocationDialog
public class ChooseRemoteLocationDialog extends
          ChooseLocationDialog<RemoteLocation> {
     private JTextField hostField;
     private JTextField portField;
     private static final long serialVersionUID = -2282249521568378092L;
     @Override
     protected JPanel prepareForm() {
          JPanel panel = new JPanel(new GridLayout(2, 2));
          panel.add(new JLabel("Host"));
          hostField = new JTextField(15);
          panel.add(hostField);
          panel.add(new JLabel("Port"));
          portField = new JTextField(15);
          panel.add(portField);
          return panel;
     @Override
     protected RemoteLocation prepareLocation() {
          String host = hostField.getText();
          int port = 0;
          try {
               String portText = portField.getText();
               port = Integer.getInteger(portText);
          } catch (NumberFormatException e) {
               e.printStackTrace();
          RemoteLocation location = new RemoteLocation(host, port);
          return location;
}Code for RemoteLocation:
public class RemoteLocation {
     private String host;
     private int port;
     public RemoteLocation() {
          super();
     public RemoteLocation(String host, int port) {
          super();
          this.host = host;
          this.port = port;
     public String getHost() {
          return host;
     public void setHost(String host) {
          this.host = host;
     public int getPort() {
          return port;
     public void setPort(int port) {
          this.port = port;
}Code snippet for dialog usage in local client implementation:
final ChooseLocationDialog<String> dialog = new ChooseLocalFileDialog();
dialog.setVisible(true);
location = dialog.getDatabaseLocation();
String filePath = location;Code snippet for dialog usage in network client implementation:
final ChooseLocationDialog<RemoteLocation> dialog = new ChooseRemoteLocationDialog();
dialog.setVisible(true);
RemoteLocation location = dialog.getDatabaseLocation();Exception that I'm getting:
Exception occurred during event dispatching:
java.lang.NullPointerException
     at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:42)
     at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:1)
     at suncertify.client.gui.dialog.ChooseLocationDialog$SelectLocationAction.actionPerformed(ChooseLocationDialog.java:87)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
     at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
     at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
     at java.awt.Component.processMouseEvent(Component.java:6134)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
     at java.awt.Component.processEvent(Component.java:5899)
     at java.awt.Container.processEvent(Container.java:2023)
     at java.awt.Component.dispatchEventImpl(Component.java:4501)
     at java.awt.Container.dispatchEventImpl(Container.java:2081)
     at java.awt.Component.dispatchEvent(Component.java:4331)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
     at java.awt.Container.dispatchEventImpl(Container.java:2067)
     at java.awt.Window.dispatchEventImpl(Window.java:2458)
     at java.awt.Component.dispatchEvent(Component.java:4331)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
     at java.awt.Dialog$1.run(Dialog.java:1046)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)java version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode, sharing)
OS: Ubuntu 8.04
Appreciate any help.
Thanks.
Edited by: spyboost on Jul 24, 2008 5:38 PM

What a silly error! I have to call Integer.parseInt instead of getInt. Integer.getInt tries to find a system property. A small misprint, but a huge amount of time to debug. I always use parseInt method and couldn't even notice that silly misprint. Sometimes it's useful to see the trees instead of whole forest :)
It works perfectly. Sorry for disturbing.

Similar Messages

  • TS3297 Why I can't download a free game I get a message that there's a problem with my payment method but not what it is this is a free app I tried support and got nowhere help

    Why can't I down load a free app  I get a message that there is a problem with my payment method but I gave all information correctly , I did recently change my card no because I lost my old one .i did change the no. On my account      HOPE YOU HAVE SOME SUGGESTIONS  I DON'T SEE WHY THEY HAVE TO CHECKMY PAYMENT METHOD FOR A FREE GAME

    Contact iTunes customer support.
    We're all users like yourself and as such have no access to your account.

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • Problem with the renameTO method in the Linux environment

    Hi
    I got a problem with the renameTO method in the Linux environment. The file is not moving.
    This method is returning false. the same code executed successfully in Windows environment.
    Can anyone give some fix to this one or an alternate solution to move the files in both windows and Linux.
    boolean success;
    File root = new File(tempPath);
                   File f = new File(root, phyFileName);
                   File dest = new File(targetPath);
    success = f.renameTo(new File(dest, actualFileName));actualFileName = 400.doc
    dest = /home/jboss-4.0.3/axsscm_1.0/axsscmDocuments/xchange/fileup/fshare/PO/1786

    JITHENDRA wrote:
    Thanks for the prompt replyNo problem.
    >
    Can u solve the below doubt.
    Will renameTo method wont work in Linux? If so why?Did you not read what I said? I suspect you are trying to rename a file so that it actually has to be moved to a different volume (partition or hard disk) so it won't work. One would have the same problem on Windows trying to rename a file on the c: drive to a name on the d: drive.
    >
    >
    Can u give a sample or good link to do the above work which works fine in all environments.?Just follow the pseudo code I gave. 15 minutes work.

  • Problems with the dispatchEvent-Methode

    Hallo,
    I have a strange problem with above mentioned methode
    I have a JTextField, and I want that only numeric inputs are
    accepted, so I used a KeyListener -Interface in the following way
    public void keyTyped(KeyEvent e)
    JTextField field =(JTextField)e.getSource();
    char c =e.getKeyChar();
    if(c>57 | c<46 |c==47 &&c >31)
    field.dispatchEvent(e);
    the other methodes keyPressed and keyReleased are implemented in the same way.
    So if I type in now in my JTextField an 'a' or whatsoever
    then the following Exception occurs:
    java.lang.StackOverflowError
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1483)
    at java.awt.EventQueue.setCurrentEventAndMostRecentTime(EventQueue.java:731)
    at java.awt.Component.dispatchEventImpl(Component.java:3448)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    Mmh, and this is not the whole Exception message.
    There are missing a couple of lines.
    But may be one of you knows what my mistake is.
    Thanks advance.

    This is not the best way to validate for numerics. Check out the "Creating a Validated Text Field" section from the Swing tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation

  • Problem with Web Template

    Hi,
    We are facing some problem in WAD.
    We have developed some reports based on views and as well on queries.
    As per our requirement we merged all the reports in a Standard web Template, and we are using table and graph as web items for the template, here the user can select any report becoz we have query selection option, then it will display the particular report. But we are getting the problem with the Template.
    While publishing the template we will get three tabs 1.DATA ANALYSIS, 2. GRAPHICAL DISPLAY 3.INFORMATION. in the initial screen that means in the DATA ANALYSIS tab it should display only the table, but in our case it is displaying both table and graph.
    And also if you select graphical tab then that should highlight the particular tab and with the particular graph, but the tabs is not highlighting when you selecting that.
    If you have any solutions please let us know.
    Regards,
    Nossum Chandu.

    Hi
    I have having almost similar problem. The difference is that it is other way around.
    The problem is from Development server instead from production. I am not using slandered template.
    I have done following but fail to resolve it-
    1) Loading templates using WAD gives inconsistency error. Object "...." is inconsistent.
    Recalling query in QD returns following two errors "BEx transport request is not available or not suitable 0", "Choose an existing request 0"
    2) While running the query using TX RSRT2 (Query Monitor support package X), returns error "An error has occurred in the script of this page" Line 11039, Char 1, Error Access is denied and so on...
    3) ICM ok, Services are checked.
    4) SM50 log does not give any clues
    5) There is no URL issue.
    6) BW Functionalities are active.
    Could some suggest?
    Thanks in advance

  • Problem with calling onApplicationStart() method

    Hi all,
         I have a problem with calling application.cfc's methods from coldfusion template. The problem is like when i am calling "onapplicationstart" method inside a cfml template i getting the error shown below
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
    My code is like below.
    Application.cfc
    <cfcomponent hint="control application" output="false">
    <cfscript>
    this.name="startest";
    this.applicationtimeout = createtimespan(0,2,0,0);
    this.sessionmanagement = True;
    this.sessionTimeout = createtimespan(0,0,5,0);
    </cfscript>
    <cffunction name="onApplicationStart" returnType="boolean">
        <cfset application.myvar = "saurav">
    <cfset application.newvar ="saurav2">
        <cfreturn true>
    </cffunction>
    </cfcomponent>
    testpage.cfm
    <cfset variables.onApplicationStart()>
    I have tried to call the above method in different way also like
    1--- <cfset onApplicationStart()>
    i got error like this
    Variable ONAPPLICATIONSTART is undefined.
    2---<cfset Application.onApplicationStart()>
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity
    Please help me out.
    Thanks
    Saurav

    You can't just call methods in a CFC without a reference to that CFC. This includes methods in Application.cfc.
    What are you trying to do, exactly, anyway? You'd probably be better served by placing a call to onApplicationStart within onRequestStart in Application.cfc, if your goal is to refresh the application based on some condition:
    <cffunction name="onRequestStart">
         <cfif someCondition>
              <cfset onApplicationStart()>
         </cfif>
    </cffunction>
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Problem with CSS/Template in IE display

    Hi,
    I have a problem with a new web site
    http://www.halloween-mayhem.com.
    The CSS is at
    http://www.halloween-mayhem.com/MasterCSS3Col240606.css
    and the template at
    http://www.halloween-mayhem.com/Templates/MasterHM3Col250606.dwt
    When viewed in Firefox everything is fine, but in IE the
    content slips right down the page to beyond the menu . Any idea
    what I have missed or done wrong please?
    Any help greatly appreciated.
    Roy

    The slipping content is too wide for the space you've
    allotted. Make it 3px
    narrower.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "roythom" <[email protected]> wrote in
    message
    news:ecti8e$ohh$[email protected]..
    > Hi,
    >
    > I have a problem with a new web site
    http://www.halloween-mayhem.com.
    The
    > CSS
    > is at
    http://www.halloween-mayhem.com/MasterCSS3Col240606.css
    and the
    > template
    > at
    http://www.halloween-mayhem.com/Templates/MasterHM3Col250606.dwt
    >
    > When viewed in Firefox everything is fine, but in IE the
    content slips
    > right
    > down the page to beyond the menu . Any idea what I have
    missed or done
    > wrong
    > please?
    >
    > Any help greatly appreciated.
    >
    > Roy
    >

  • Problems with blog template

    I'm having two problems with the blog template. First, I wanted to add some images to a blog entry in addition to the main photo at the top of the page. I had wanted these to appear below the main text box. So I selected several pictures in iPhoto and dragged them over to the current blog entry. What I got was a new photo page being created and a small image placed on my blog page that was a link to the newly created photo page that contains a thumbnail image of one of the photos on the photo page. Is there no way to simply insert additional images into a blog page? Even if I can't insert the images into my page, there is a problem with the location of that thumbnail image. It somehow got located near the bottom of the page in between the "made on a Mac" logo and the Next link. I can't seem to select it to move it to a different location. I tried right-clicking, option-clicking and clicking with every other modifier key, as well as ordinary clicking, but either nothing happens or iWeb takes me to the new photo page. How can I manipulate this thumbnail object? Finally, out of frustration about being unable to manipulate the thumbnail away from the Next/Previous links, I decided to try to move them. I started with the "Made on a Mac" logo, selected it and then pressed the down arrow. What I had expected was that my page size would increase as I moved the logo down the page. Instead, I seem to have moved the logo down so far that it has disapeared. How do I get it back? What am I doing wrong here?

    I have been corresponding with the company in Lithuania for a few days and we have tried everything we could think of to solve the glitch. I am very much aware of the fact that it is a custom theme, in fact I have further customised it.
    The website in question is a private one. In my home country, we are legally required to post our address on the page. I would not want to braodcast that across the Apple community, if I can help it, so that is not an option. Sorry.
    I would really appreciate if someone who uses GraphicNodes templates could help me out. Thank you

  • Problem with a string method

    Hello, I am working on a program that converts Roman numerals to Arabic numbers and the opposite. I have the Arabic to Roman part down, yet Roman to Arabic part is causing troubles for me.
    I know that there are many solutions out there, yet I would like just solutions within my code that would fix the problem it has.
    Instead of the whole code, here's the method that changes Roman to Arabic.
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
    There's a problem with this, however, is that whenever I put something in like XX, CC, XXX, or II, the program says
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
    at java.lang.String.charAt(String.java:687)
    at RomanNumerals.toArabic(RomanNumerals.java:172)
    at RomanNumerals.main(RomanNumerals.java:33)
    I think this problem is caused by the if-else and else-if statements in my method for cases C, X, and I, as this problem doesn't come up when I do similar things to cases without the if statements. Could you perhaps find out what is causing this problem? I've been working on it for days after finishing the rest and I can't figure it out.
    Thanks

    import java.io.*;
    public class RomanNumerals{
              public static void main (String [] args)
              DataInput keyboard=new DataInputStream (System.in);
              String input;
              try
                   //options
                   System.out.println("1. Roman numerals to Arabic numbers");
                   System.out.println("2. Arabic numbers to Roman numerals");
                   System.out.println("3. Exit");
                   System.out.print("Enter your option: ");
                   input=keyboard.readLine();
                   int choice=Integer.parseInt(input);
                   switch (choice)
                        //Roman numerals to Arabic numbers
                        case 1:
                             String romanInput, ro;
                             int answer1;
                             System.out.print("Enter a Roman numeral: ");
                             romanInput=keyboard.readLine();
                             ro=romanInput.toUpperCase();
                             answer1=toArabic(ro); //line 33 where the error occurs
                             System.out.println("The Arabic number is: "+answer1);
                             break;
                        //Arabic numbers to Roman numerals
                        case 2:
                             String arabicInput, answer;
                             System.out.print("Enter an Arabic number: ");
                             arabicInput=keyboard.readLine();
                             int arabic=Integer.parseInt(arabicInput);
                             answer=toRomans(arabic);
                             System.out.println("The Roman numeral is: "+answer);
                             break;
                        case 3:
                             break;
                        default:
                             System.out.println("Invalid option.");
              catch(IOException e)
                   System.out.println("Error");
                   //method to convert Arabic numbers to Roman numerals
         public static String toRomans (int N)
              String roman="";
              while (N>=1000)
                   roman+="M";
                   N-=1000;
              while (N>=900)
                   roman+="CM";
                   N-=900;
              while (N>=500)
                   roman+="D";
                   N-=500;
              while (N>=400)
                   roman+="CD";
                   N-=400;
              while (N>=100)
                   roman+="C";
                   N-=100;
              while (N>=90)
                   roman+="XC";
                   N-=90;
              while (N>=50)
                   roman+="L";
                   N-=50;
              while (N>=40)
                   roman+="XL";
                   N-=40;
              while (N>=10)
                   roman+="X";
                   N-=10;
              while (N>=9)
                   roman+="IX";
                   N-=9;
              while (N>=5)
                   roman+="V";
                   N-=5;
              while (N>=4)
                   roman+="IV";
                   N-=4;
              while (N>=1)
                   roman+="I";
                   N-=1;
              return(roman);
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')   //the line 172 where error occurs
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
              return(arabica);
         }When I put in XX as the input, this is what the error comes out as:
    Enter a Roman numeral: XX
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
        at java.lang.String.charAt(String.java:687)
        at RomanNumerals.toArabic(RomanNumerals.java:172)
        at RomanNumerals.main(RomanNumerals.java:33)

  • [SOLVED][GRUB]Install problem with the new method

    Hi,
    it is not my first install of Arch Linux but I have a problem with this new kind of installation method, especially with GRUB.
    Here is my hard drives configuration :
    /dev/sda1 -> SSD 120 GB ntfs (windows)
    /dev/sdb1 -> HD 1 TB ext4 (data)
    /dev/sdc :
    /dev/sdc1 -> ext2 /boot
    /dev/sdc2 -> swap
    /dev/sdc3 -> ext4 /
    /dev/sdc5 -> ext4 /home
    During the installation, I installed grub (with grub-install) in /dev/sdc. I assumed it was the correct drive to install it but apparently not, Windows starts automatically and I don't have the grub menu.
    Should I install my system again or is there a way to boot on the livecd and install it ?
    Should I :
    1) mount /dev/sdc3 in /mnt then /dev/sdc1 in /mnt/boot and finally /dev/sdc5 in /mnt/home
    2) pacstrap /mnt grub-bios
    3) arch-chroot
    4) grub-install
    Thank you.
    Last edited by hiveNzin0 (2012-09-12 06:15:15)

    DSpider wrote:
    If you set whatever drive "/dev/sdc" is (brand and model) to boot first in the BIOS, all you need to do is install a bootloader on Arch. You don't even need a separate boot partition. It will use the /boot folder on root partition. Then install os-prober (if you don't already have this installed) and re-generate the .cfg.
    https://wiki.archlinux.org/index.php/Be … bootloader
    The problem is that I cannot select another hard drive. The only one available for the boot order is the Samsung 830 series (/dev/sda with Windows).
    The other options are the CD drive and removable disk.
    I checked that this morning, maybe I was too tired. I will check again this evening.
    But if I am right and I cannot select my intel SSD (containing my arch setup) for the boot order, would the solution I described work ? I don't see why not but my knowledge are basic in Linux.
    Thank you again for your help.

  • Problem with cl_gui_frontend_services execute method

    Halo experts ,
    I am facing a peculiar problem with  cl_gui_frontend_services execute  .
    I am trying to open documents using the method execute of  cl_gui_frontend_services
    . But the problem is it is not opening file with space in its name .
    ie it is able to open 'for_example.pdf' but not 'for example.pdf'
    Any one has idea why it is happening?
    Regards
    Arshad

    HI Arshad...
    This does not seems to be a problem of GUI...
    bad parameter  exceptions is coming ...  mean you are passing an incorrect parameter ...mean incorrect file name ...or the filename you are passing does not exits in you my documents folder ...
    I have executed the same code  ... and it is perfectly working fine ... you have to pass the file name exactly ... that means  if
    you are passing L11527110.pdf then the file name should be L11527110.pdf...
    if you are passing the parameter as L 11527110.pdf (* with space )   then the file name has to be exactly same ...  other wise ...
    the application ACRORD32.EXE  opens  but gives as error ...
    please check the file name in my docs and passing parameter value ....
    I am giving my code which i did .....
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application ='ACRORD32.EXE'
    parameter = 'B CDWBDIC.pdf'
    default_directory = 'C:\Documents and Settings\Ritamadmin\My Documents\'
    maximized = 'X'
    operation = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    synchronous_failed = 8
    not_supported_by_gui = 9
    OTHERS = 10.

  • Problem with room template

    Hi All,
         I have created a new Room template and have added other iViews besides the Room calendar.
    Everything is working fine in the room except the Room calendar. I get the following error
    <i><b>"Invalid RID: 20b1bad6-5c27-2810-d199-d91203b5c46f",</b></i> which i guess is the Room Id.
    I even tried copying the "Calendar and Sessions" page from SAP Team room template into my template, but that also doesn’t work. If I create a room using SAP Team Room template the calendar works fine, but not in a room created with my template.
    The following mapping have been done
    In the page com.sap.netweaver.coll.CalendarAndSessions_0
    the property com_sap_netweaver_coll_gwui_roomid is set as room_id for component com.sap.netweaver.coll.RoomCalendar
    The stack trace shows the following error
    <i>#1.5#0002A5EF3C19004700000084000012A4000403FC3CBC5A48#1130281792354#com.sapportals.wcm.rendering.base.StatusFactory#sap.com/irj#com.sapportals.wcm.rendering.base.StatusFactory#amahto#8276####72cc642045ac11daaab50002a5ef3c19#SAPEngine_Application_Thread[impl:3]_15##0#0#Error##Plain###No status mapped to the given list type <http://sap.com/xmlns/collaboration/rooms/room> using hard coded default#</i>
    Am I missing something somehwere?
    Thanks, Akhilesh

    Okay, found the problem. It was indeed some configuration that I've forgot.
    com.sap.netweaver.coll.RoomInformationExtended
    iView property com_sap_netweaver_coll_information_roomid = room_id (=parameter)

  • FileWriter problem with my toptenScores method!!!

    Hey ya'll -- i'm STILLLLLL writing this dumb trivia program. I'm now having a problem with the FileWriter - that writes the final scores BACK to the toptenFile.
    I'm hoping all these troubles are just growing pains of my first "big" program (big for me) - BUT I WORKED on this honker all night last night and into this afternoon and I am at my wits end!
    I am posting the writing portion below hoping I am just missing something, but if you guys need the whole code let me know -- and below this code I will show the error I am getting as it trys to write to the file. ---
    if (questionsMissed == 3 )
    if (score > topScoresInt[0])
    String name = JOptionPane.showInputDialog(null,
    "GAME OVER. Your score is " + score + "\n Please enter you initials - no spaces", // Message to display
    "You got a High Score!", JOptionPane.INFORMATION_MESSAGE);
    try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(toptenFile)); String[] scorestoFile = new String[10];
    scoreToFile[0] = (score + " " + name);
    bw.write(scoreToFile[0] + "\n");
    for (i=1; i<=9; i++)
    bw.write(scoreToFile[i] + "\n");
    bw.close();
    System.exit(0);
    } catch (IOException ex) {
    ex.printStackTrace();
    HERE IS THE ERROR WHEN IT TRIES TO WRITE TO THE FILE
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at java.io.Writer.write(Writer.java:126)
    at TriviaGame$answerButtonHandler.actionPerformed(TriviaGame.java:299)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener$Actions.actionPerformed(BasicButtonListener.java:285)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2798)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
    at java.awt.Component.processEvent(Component.java:5265)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    OK - that helped me!
    I was making the string because I had to stringify the sorting class that I had made earlier -- BUT I FORGOT to stringify -- this is the code I had left out.
    for (i=1; i<=9; i++)
    scoreToFile = top{i}.toString();
    bw.write(scoreToFile[i] + "\n");
    NOW THAT SOLVED EVERYTHING BUT ONE MORE THING!!!!
    IT now writes to the file just fine but I CANT get it to give me a new line -- it is writing everything on one line.... (see how I tried an line break above? -- didnt work) -- any help on getting a line break?
    ** BTW - I just found out and BEFORE you jump on this -- I HAD to change the Arrays above to {i} from the bracket i because it was making it ITALICS and not showing it -- so disregard the curly brace syntax issue above please.
    Message was edited by:
    tvance929

  • Problem with seting action method to a Hyperlink object

    Hi there,
    as the subject says, I have a problem wih setting the action method of a Hyperlink object. Here is how the program is organized:
    I have an external bean which generates an ArrayList of Hyperlink objects. In the backing bean of my web page I call a method from the above mentioned external bean to generate the list of hyperlink objects. After that in the page bean I insert the hyperlink objects in GridPanel component. So far everything works fine, but the action method of the Hyperlink objects is not called and I can't understant why.
    Here is how I add the objects to the GridPanel component:
    private void populateGridPanel()
            Hyperlink hyper;
            for(int i=0; i< checkboxList.size(); i++)
                    hyper = (Hyperlink) hyperlinkList.get(i);
                    vehicleGridPanel.getChildren().add(hyper);
        }All properties of the Hyperlink objects are set in the external bean not in the page bean, here is how:
    //action method executed when the hyperlink is clicked
    MethodBinding mb = (MethodBinding) FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{Page1.hyperlink_action}", null);
    veHyperlink.setAction(mb);The populateGridPanel() method is called in the init() method of the page bean, after the initialization of all other components.
    An interesting fact is that if I manually drag-n-drop a hyperlink object to my page and programatically set its action method with the code above everything works fine. But using the same code for the dynamically generated hyperlink objects inserted in the grid panel doesn't work.
    Any kind of help is highly appreciated.
    Thanks!
    Message was edited by:
    panayot

    I got this use case to work as follows:
    1. Drag a Grid Panel and set its columns property to 1.
    2. Drag a Message Group.
    3. Use the following code in Page1:
    public void prerender() {
    populateGridPanel();
    private void populateGridPanel() {
    if (gridPanel1.getChildren().size() > 0) {return;}
    for (int i = 0; i < 3; i++) {
    Hyperlink veHyperlink = new Hyperlink();
    //action method executed when the hyperlink is clicked
    MethodBinding mb = (MethodBinding) FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{Page1.hyperlink_action}", null);
    veHyperlink.setAction(mb);
    veHyperlink.setText("dynamic hyperlink " + i);
    veHyperlink.setId("dynamicHyperlink" + i);
    gridPanel1.getChildren().add(veHyperlink);
    public void hyperlink_action() {
    info("Yup it worked at: " + new java.util.Date());
    4. Fix imports, Run, and then click on the hyperlinks.

Maybe you are looking for

  • Creation of Report

    Hi Guys, I have to create a report in 7.0. there is only one Characterstic(Materail Group) and two k.figures Volume and Values and the quantity based on pack. and need to in each at result output. both key figures want for last year, this year plan,

  • Problem in adding custom metada properties

    Hi All, I want to add some custom properties while creating a document in KM repository. I am getting problem while adding the custom group in the property structure "all_groups"... This is waht i have done so far, 1) I created the custom metadata pr

  • How to execute my procedure automatically every second

    dear all i made a procedure that simply insert a record in a table . i need to execute this procedure automatiaclly every one second. how can i achive this. please help

  • Chinese menues in Pages - how to?

    i am having a hard time changing the menu dialogues of iwork - pages and keynote - to chinese. tried it with iwork 05 and 06 (got two computers) which i want to donate for a good purpose here in taiwan. os x runs in its latest version 10.4.8 in tradi

  • Adobe premier pro not working on w530

    i have w530 and adobe premier pro not working any body can help i increased the ram to 32 gb but still not working