How to code...need help

I have the following code in my method:
this.setEditable(componentId : "recipient", editable : true);
this.setRequired(componentId : "recipient", required : true);
I would like to pre populate the recipient field from my database. Can anyone help with the syntax?

So where do you want to write your SQL code. I hope you have once writen the SQL code to get the records from database.
If you have any global activity for creating the instance, then you can write your SQL code there and then assign the values from the table to some argument and then map those argument to the Catalog object.attribute = arg
If not, then you can put one automatic activity before you display the presentation. And in that automatic activity, you place your SQL code, and then assign the value retrieved from the database, to the Object.attribute
Jst pasting one sample code:
for each row in
SELECT address
FROM RECORD.YOURAPPL.YOURTABLE
WHERE your condition
do
CatalogObjectName.AttributeName = row.address
end
You will need to map the CatalogObject to your screenflow.
Regards
Right Chord
Edited by rightchord at 07/13/2007 12:27 AM

Similar Messages

  • New to code, need help please!!!

    I have been designing my first website by following a string of videos I have purchased online. (Timothy Training w/ Framework Files) I am finally to the point that I am ready to 'put' these file on my business catalyst account and get them online. I have run into an issue however. I have a page called services.html and within it I have built a 'featured content slider' that links to several pages. The code was working perfectly in any browser that I previewed it in, live view, inspections, everything was fine!! Until, I 'put' the files onto my business catalyst account, now all of the sudden the code does not display correctly anymore. I have made no changes to the code what-so-ever, no changes to the style sheets, nothing. I had a tech support guy that took a 'quick look' and said that my outer div was all of the sudden in the wrong place. I dont understand how 1. it shifted when I made no changes, 2. It works perfectly fine when I view it outside of BC platform and 3. how to even begin to fix the issue. I have spent hours upon hours trying to remedy this myself and I am finally at a breaking point and quite desperate for help. I have so many hours into this site and I am quite frustrated that I made it this far only for it to fail. Please anyone that is willing to take a look I would be grateful. I am not sure if I should post the code in here or not as this is my first post in the forum. I guess I will try to copy and paste and see if that works. Any suggestions would be great help.. Thank you so much!
    I will copy and paste the code in this order: (I think this is all the code needed to figure it out,I hope...)
    services.html
    featureList.js
    featured.css
    styles.css
    services.html
    <!DOCTYPE HTML>
    <html><!-- InstanceBegin template="/templates/ts_fullwidth.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
              <script type="text/javascript" src="js/jquery.js"></script>
        <link href="css/styles.css" rel="stylesheet" type"text/css" media="screen">
        <link href="css/print.css" rel="stylesheet" type"text/css" media="screen">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Type" content="cache" />
        <meta name= "robots" content="INDEX,FOLLOW" />
        <meta name= "keywords" content="Enter Keywords" />
        <meta name= "description" content="Description Here" />
    <!-- InstanceBeginEditable name="doctitle" -->
        <title>Web Site by Tahoe POS Systems LLC - www.tahoesystems.com</title>
                  <script type="text/javascript" src="js/featureList.js"></script>
        <link rel="stylesheet" href="css/featured.css" />
              <script language="javascript">
                        $(document).ready(function() {
                                  $.featureList(
                                            $("#tabs li a"),
                                            $("#output li"), {
                                                      start_item          :          1
              </script>
        <!-- InstanceEndEditable -->
        <!-- Google Analytics Code Goes Below Here -->
        <!-- End Google Analytics Code -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div id="outer">
              <div id="wrapper">
                        <div id="logo">
                      <img src="images/logos/logo2.png" />
            </div>
            <div id="social-media-icons">
                      <ul>
                          <li><a href="http://www.facebook.com/tahoesystems"><img src="images/icons/facebook_32.png" /></a></li>
                    <li><a href="#"><img src="images/icons/rss_32.png" /></a></li>
                    <li><a href="http://www.twitter.com"><img src="images/icons/twitter_32.png" /></a></li>
                    <li><a href="http://www.youtube.com"><img src="images/icons/youtube_32.png" /></a></li>
              </ul>   
            </div>
            <div id="topnav">
                      <ul>
                          <li><a href="index.html">HOME</a></li>
                    <li><a href="about.html">ABOUT US</a></li>
                    <li><a href="clients.html">CLIENTS</a></li>
                    <li><a href="services.html">SERVICES</a></li>
                    <li><a href="contact.html">CONTACT US</a></li>
                </ul>   
            </div>
            <div id="banner">
                      <img src="images/banner/b1.png" />
            </div>
            <div id="content-fullwidth"><!-- InstanceBeginEditable name="content" -->
              <h1>Welcome to Tahoe Systems Web Site!</h1>
              <p>Our Mission – To ensure your restaurant, bar, café, diner, or eatery operates smoothly. Streamline your workflow by providing the latest, most up-to-date technology the industry has to offer. Maximize your profits with a personalized POS system that works for you and not against you. Ease your stress with the quickest, most reliable, 24-hour technical support in the area. Train your staff in person with one-on-one classes taught by one of our certified staff.</p>
           <div id="feature">
                        <h1>Featured Tahoe Systems Services</h1>
            <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
                                  <div id="feature_list">
                                            <ul id="tabs">
                                                      <li>
                                                                <a href="javascript:;">
                                                                <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>Complete Menu Design</h3>
                                                                          <span>Complete with our well-known Fast Bar Page </span>
                                                                </a>
                                                      </li>
                                                      <li>
                                                                <a href="javascript:;">
                                                                          <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>Kitchen Printing with ease</h3>
                                                                          <span>Top of the line printing systems</span>
                                                                </a>
                                                      </li>
                                                      <li>
                                                                <a href="javascript:;">
                                                                <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>VPEN Monitor Systems</h3>
                                                                          <span>HD Screens, Bump Bars, We can do it all!</span>
                                                                </a>
                                                      </li>
                                            </ul>
                                  <ul id="output">
                                                      <li>
                                                                <img src="images/feature_slider/menu-sample2.jpg" />
                                                                <a href="menu.html">Menu Gallery</a>
                                                      </li>
                                                      <li>
                                                                <img src="images/feature_slider/tmu220.jpg" />
                                                                <a href="print.html">Printing Gallery</a>
                                                      </li>
                                                      <li>
                                                                <img src="images/feature_slider/kds_hnet.jpg" />
                                                                <a href="vpen.html">VPEN Gallery</a>
                                                      </li>
                                            </ul>
                                  </div>
              </div>
              <p>Our Mission – To ensure your restaurant, bar, café, diner, or eatery operates smoothly. Streamline your workflow by providing the latest, most up-to-date technology the industry has to offer. Maximize your profits with a personalized POS system that works for you and not against you. Ease your stress with the quickest, most reliable, 24-hour technical support in the area. Train your staff in person with one-on-one classes taught by one of our certified staff.</p>
            <!-- InstanceEndEditable --></div>
            <div id="footer">
                       <p class="footer-text">All Rights Reserved - Tahoe Systems - 2012</p>
            </div>
       </div>
    </div>
    </body>
    <!-- InstanceEnd --></html>
    featureList.js
    * FeatureList - simple and easy creation of an interactive "Featured Items" widget
    * Examples and documentation at: http://jqueryglobe.com/article/feature_list/
    * Version: 1.0.0 (01/09/2009)
    * Copyright (c) 2009 jQueryGlobe
    * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License
    * Requires: jQuery v1.3+
    ;(function($) {
              $.fn.featureList = function(options) {
                        var tabs          = $(this);
                        var output          = $(options.output);
                        new jQuery.featureList(tabs, output, options);
                        return this;
              $.featureList = function(tabs, output, options) {
                        function slide(nr) {
                                  if (typeof nr == "undefined") {
                                            nr = visible_item + 1;
                                            nr = nr >= total_items ? 0 : nr;
                                  tabs.removeClass('current').filter(":eq(" + nr + ")").addClass('current');
                                  output.stop(true, true).filter(":visible").fadeOut();
                                  output.filter(":eq(" + nr + ")").fadeIn(function() {
                                            visible_item = nr;
                        var options                              = options || {};
                        var total_items                    = tabs.length;
                        var visible_item          = options.start_item || 0;
                        options.pause_on_hover                    = options.pause_on_hover                    || true;
                        options.transition_interval          = options.transition_interval          || 5000;
                        output.hide().eq( visible_item ).show();
                        tabs.eq( visible_item ).addClass('current');
                        tabs.click(function() {
                                  if ($(this).hasClass('current')) {
                                            return false;
                                  slide( tabs.index( this) );
                        if (options.transition_interval > 0) {
                                  var timer = setInterval(function () {
                                            slide();
                                  }, options.transition_interval);
                                  if (options.pause_on_hover) {
                                            tabs.mouseenter(function() {
                                                      clearInterval( timer );
                                            }).mouseleave(function() {
                                                      clearInterval( timer );
                                                      timer = setInterval(function () {
                                                                slide();
                                                      }, options.transition_interval);
    })(jQuery);
    featured.css
    #feature
    font-family: "Trebuchet MS",Verdana,Arial,sans-serif;
    font-size: 14px;
    line-height: 1.6;
    width: 750px; /* This is the width  */
    margin: 25px auto; /* margin top/bottom and centering  */
    padding: 20px; /* Padding inside */
    background: #FFF;
    /* Background color  */
    border: 1px solid #CCC; /* border around  */
    #feature h1 { margin: 0; }
    #feature p
    { margin: 0; padding: 7px 0; }
    .clear
    { clear: both; line-height: 1px; font-size: 1px; }
    #feature a
    { outline-color: #888;
    #feature h3 { margin: 0;
    padding: 7px 0 0 0;
    font-size: 16px; text-transform: uppercase;
    ul#tabs li a h3
    { color:#F60; margin-bottom: 5px; ; }
    div#feature_list
    width: 750px; height: 240px;
    overflow: hidden; position: relative;
    div#feature_list ul {
    position: absolute;
    top: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    ul#tabs {
    left: 0;
    z-index: 2;
    width: 320px;
    ul#tabs li { font-size: 12px; font-family: Arial; }
    ul#tabs li img {
    padding: 5px; border: none; margin: 0px 10px 0 0;
    float: left;
    ul#tabs li a
    color: #222;
    text-decoration: none;
    display: block;
    padding: 10px;
    height: 60px;
    outline: none;
    ul#tabs li a:hover { color:#822B00; }
    ul#tabs li a.current {
    background:url(../images/feature-tab-current.png);
    color: #FFF;
    ul#tabs li a.current:hover {
    text-decoration: none;
    cursor: default;
    ul#output {
    right: 0;
    width: 460px; height: 240px;
    position: relative;
    ul#output li {
    position: absolute;
    width: 460px; height: 240px;
    ul#output li a {
    position: absolute;
    bottom: 10px; right: 10px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 11px;
    color: #FFF;
    background: #000;
    -moz-border-radius: 5px;
    ul#output li a:hover { background:#B33A00; }
    and finally styles.css
    /* CSS Document */
    /* Color Legend */
    /* Reset */
    html, body { margin; 0; padding: 0; border: 0; background: transparent; font-size:10px; }
    div, span, article, aside, footer, header, hgroup, nav, section,
    h1, h2, h3, h4, h5, h6, p, blockquote, a, ol, ul, li,
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0;
              padding: 0;
              border: 0;
              verticle-align: baseline;
              background: transparent; }
    img                    {margin: 0; padding: 0; border: 0; }
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0; padding: 0; border: 0;
              verticle-align: baseline;
              background: transparent; }
    table {border-collapse: collapse; border-spacing: 0; }
    input, select, textarea, form, fieldset {
              margin: 0; padding: 0; border: 0; }
    article, aside, dialog, figure, footer, header, hgroup, nav, section {
              display:block; }
    h1, h2, h3, h4, h5, h6, p, li, blockqutoe, td, th, a, caption, em, strong, strike {
              font-family: Arial, Helvetica, sans-serif;
              font-size:100%;
              font-weight: normal;
              font-style: normal;
              line-height: 100%;
              text-indent: 0;
              text-decoration: none;
              text-align: left;
              color: #000; }
    ol, ul, { list-style: none; }
    /* Global */
    html          {          }
    body          {          background-color:#E8DDCA;
                                  background-image:url(../images/background/roiBody_11.png);
                                  background-repeat:no-repeat;
                                  background-attachment:fixed; }
    /* Headings */
    h1, h2, h3, h4, h5, h6 { font-weight: bold; }
    h1 { font-size:24px; color: #C60 ;
                        padding-bottom: 15px; border-bottom: 1px #ccc solid; margin-bottom: 15px; }
    h2 { font-size: 20px; }
    h3 {font-size: 16px; margin-bottom: 5px; }
    h4 {font-size: 14px; }
    h5 {font-size: 14px; }
    h6 {font-size: 14px; }
    h1 img, h2 img, h3 img, h4 img, h5 img, h6 img, {margin: 0; }
    /* Text Elements */
    p                                        { color:#000; font-size: 12px; line-height: 150%;
                                                      margin: 15px 0px; }
    p. left                              {margin: 1.5em 1.5em 1.5em 0; padding: 0; }
    p. right                     {margin: 1.5em 0 1.5em 1.5em; padding: 0; }
    a                                        {          }
    a:link                              {color: #00f; }
    a:visited                    {color: #0f0; }
    a:active                    {color: #000; }
    a:focus                              {color: #666; }
    a:hover                              {color: #f00; }
    blockquote                    {color: #000; font-size: 12px; }
    strong                              { font-weight: bold; }
    em                                         {font-style: italic; }
    /* Images */
    .image-frame          { padding: 10px; border: 1px #ccc solid; margin: 10px; }
    /* Lists */
    ul                                        {          }
    ol                                        { list-style-type:decimal; }
    ul li                              {color: #000; font-size: 12px; }
    ol li                              {color: #000; font-size: 12px; }
    dl                                        {          }
    dt                                        {          }
    dd                                        {          }
    /* Tables */
    table                              { width: 100%; }
    tr                                         {          }
    .odd                              { background-color: #eee; }
    .even                              { background-color: #fff; }
    th                                         { font-weight:bold; }
    thead, th                    { background: #ccc; }
    tbody                              {          }
    th,td,caption           {          }
    caption                     {          }
    tfoot                              {          }
    .tfooter                    { background-color:#ccc; text-align: center; font-style: italic;
    caption                              { background-color: #efefef;
    /* Miscelaneous */
    sup, sub                    {line-height: 0; }
    abbr, acronym          { border-bottom: dotted #666; }
    address                              {          }
    del                                        {background: #ffcece; color: #f00; }
    code, pre                    { background-color:#ff9; padding: 2px 0px; margin: 4px 25px;
                                                      font-family: "Courier New", Courier, monospace; font-size: 12px; font-weight:bold
    /* Containers */
    #outer                              { width:960px; margin:0 auto; background-color:#FFF; }
    #wrapper                    { width:900px; margin:0 auto; background-color:#FFF; }
    #logo                              { margin:30px 0; float: left; }
    #social-media-icons                     { float:right;                               }
    #social-media-icons ul li           { display: inline;                     }
    #social-media-icons ul                    { margin-top: 40px;           }
    #topnav                                        { clear: both; }
    #topnav ul                              { border-top: 1px #000 solid; border-bottom: 1px #000 solid;
                                                                margin: 20px 0; padding: 10px 0; }
    #topnav ul li                    { display: inline          }
    #topnav ul li a                    { padding: 0 15px;          }
    #topnav          a:link                              {color: #000; }
    #topnav          a:visited                    {color: #000; }
    #topnav          a:active                    {color: #000; }
    #topnav          a:focus                              {color: #666; }
    #topnav          a:hover                              {color: #F90; }
    #banner                                        { margin-bottom: 30px;           }
    #slider                                        { margin-bottom: 30px; }
    #content                              { width: 650px; float: left;          }
    #content-fullwidth          { width: 100%; }
    #rightside                              { width: 200px; float: right;          }
    #footer                                        { clear: both; margin-top: 20px 0; border-top: 1px #ccc solid;          padding-bottom: 20px; }
    #box1          { width: 250px; float: left; margin: 25px; 
                                  border-top: 15px #666 solid; background-color:#EEE;          }
    #box2          { width: 250px;          float: left; margin: 25px;
                                  border-top: 15px #3E5838 solid; background-color:#EEE;          }
    #box3          { width: 250px;          float: left; margin: 25px;
                                  border-top: 15px #386165 solid; background-color:#EEE;          }
    #box1 h3, #box2 h3, #box3 h3 { margin: 20px 10px 10px 10px; }
    #box1 p, #box2 p, #box3 p { margin: 5px 10px 10px 10px; }
    #box4          {                    }
    #box5          {                    }
    #box6          {                    }
    /* Layout Extra */
    /* Navigation Extra */
    /* Forms */
    form ol { list-style-type:none; }
    form           { text-align:left; margin:20px;          }
    label           {
                        float: left; width: 150px; margin-top:5px;
                        text-align:right; display:block; background:none; font-weight:bold;
    submit          { background:none;           }
    input           {
                        width: 280px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    input:focus, textarea:focus          { background-color:#FF9; }
    textarea {
                        width: 280px; height: 150px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    select { margin-bottom:20px;          }
    .month { margin-left:155px;          }
    .submit {
                        width:90px; height:25px;
                        margin-left:160px;
                        font-size:12px;
    br                    { clear: left;           }
    .clear          { clear:both; }
    /* Miscelaneous */
    .popup-link                    { font-size: 12px; margin: 5px 10px; display:block; }
    .date                              { font-weight: bold; color: #C60; margin-bottom: 3px; }
    .copyright-text { font-size:80%; font-style: italic; color: #333; }
    .footer-text          { font-size:12px; font-style: normal; color: #000; text-align: center; }
    .title                              { font-size:18px; font-weight: bold; color: #333; }
    .subtitle                    { font-size:14px; font-style: italic; color: #333; }
    .artist                     { font-size:16px; font-weight: bold; color: #333; }
    .author                              { font-size:14px; font-weight: bold; color: #555; }
    .editor                              { font-size:14px; font-style: italic; color: #555; }
    .pub-date                    { font-size:10px; font-style: italic; color: #555; }
    .article-date          { font-size:10px; font-style: italic; color: #555; }
    .location                    { font-size:10px; font-style: italic; color: #555; }
    .float-right          { float:right; }
    .float-left                    { float:left; }
    .clear                              { clear:both; }
    .hide                              { display:none; }
    .block                              { display:block; }
    .inline                              { display:inline; }
    .first                              { font-weight:bold; }
    .last                              { font-weight:bold; }
    .left                              { font-weight:bold; text-align:left; }
    .right                              { font-weight:bold; text-align:right; }
    .added                              { background:#D7D7FF; }
    .removed                    { background:#FFCECE; color:#f00; }
    .changed                    { background:#FFB; }

    http://tahoepossystems.businesscatalyst.com/services.html
    Services page is missing quite a bit of stuff.
    This code from a working page is correct:
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='EN';</script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/needsomethinghere.js"></script>
    <script type="text/javascript" src="../js/slider.js"></script>
    <script type="text/javascript">  // This is the script for the banner slider
    $(document).ready(function() {
    $('#slider').s3Slider({
    timeOut: 6000
    </script>
    <link href="../css/styles.css" rel="stylesheet" css" media="screen">
    <link href="../css/print.css" rel="stylesheet" css" media="screen">
    <link href="../css/slider.css" rel="stylesheet" type="text/css" media="screen">
    In contrast, this is all you have in the <head> of your services.html page:
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='EN';</script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <link href="../css/styles.css" rel="stylesheet" type="text/css" media="screen">
    <link href="../css/print.css" rel="stylesheet" type="text/css" media="screen">
    If you reconcile those difference in your code, it should work.
    Nancy O.

  • HOW TO?: Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Any devices connected to the same icloud account can sync all the data on that account.  For this reason an icloud account is really for a single user.
    On a mac, if each user has their own account, then the itunes for that mac account should be set up to connect to that user's icloud account (System preferences>icloud).

  • Error in code, need help

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class CropProfit2 extends JApplet implements ActionListener
    private JTextField n1Text = new JTextField();
    private JTextField n2Text = new JTextField();
    private JTextField n3Text = new JTextField();
    private JTextField n4Text = new JTextField();
    private JTextField ansText = new JTextField();
    //Create text fields
    private JLabel Instructions = new JLabel("Enter number of acres for desired for each crop then press cost or reveune");
    private JLabel n1Label = new JLabel("Enter acres of soybeans here");
    private JLabel n2Label = new JLabel("Enter acres of corn here");
    private JLabel n3Label = new JLabel("Enter acres of potatos here");
    private JLabel n4Label = new JLabel("Enter acres of wheat here");
    private JLabel answerLabel = new JLabel("Total cost or revenue");
    //Create direction labels
    private JButton costButton = new JButton("cost");
    private JButton revenueButton = new JButton("revenue");
    private JButton profitButton = new JButton("profit");
    double sum;
    double n1;
    double n2;
    double n3;
    double n4;
    //Create buttons and declare double variables
    public void init()
    ansText.setEditable(false);
    JPanel content = new JPanel(new GridLayout(5,2,1,1));
    //content.add(Instructions);
    content.add(n1Label);
    content.add(n1Text);
    content.add(n2Label);
    content.add(n2Text);
    content.add(n3Label);
    content.add(n3Text);
    content.add(n4Label);
    content.add(n4Text);
    content.add(answerLabel);
    content.add(ansText);
    //Add labels and input boxes
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(costButton);
    buttonPanel.add(revenueButton);
    buttonPanel.add(profitButton);
    //Add 3 calculation buttons
    add(content, BorderLayout.NORTH);
    add(buttonPanel, BorderLayout.SOUTH);
    //Button panel on bottom
    revenueButton.addActionListener(this);
    costButton.addActionListener(this);
    profitButton.addActionListener(this);
    //Make buttons listen
    public void actionPerformed(ActionEvent e);
    if (e.getActionCommand().equals("cost"))
    n1 = stringToDouble(n1Text.getText());
    n2 = stringToDouble(n2Text.getText());
    n3 = stringToDouble(n3Text.getText());
    n4 = stringToDouble(n4Text.getText());
    totalCost = (n1 * 900) + (n2 * 100) + (n3 * 750) + (n4 * 800);
    //Calculate cost total
    ansText.setText(Double.toString(totalCost));
    //Write total to label
    else if (e.getActionCommand().equals("revenue"))
    n1 = stringToDouble(n1Text.getText());
    n2 = stringToDouble(n2Text.getText());
    n3 = stringToDouble(n2Text.getText());
    n4 = stringToDouble(n2Text.getText());
    totalPrice = (n1 * 1300) + (n2 * 1650) + (n3 * 1200);
    //Calculate sell price total
    ansText.setText(Double.toString(totalPrice));
    //Write total to label
    else
    ansText.setText("Error");
    private static double stringToDouble(String stringObject);
    return Double.parseDouble(stringObject.trim());
    and the errors i get is
    CropProfit23.java:104: 'class' or 'interface' expected
    ^
    CropProfit23.java:105: 'class' or 'interface' expected
    ^
    2 errors
    I really don't know how to fix it. I'm extremely new at this stuff and can't get this assignment to work for class. Any help would be greatly appreciated.

    Your code style is extremely poor.
    This compiles and runs. Compare it to yours to see where you went wrong. - %
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class CropProfit2 extends JApplet implements ActionListener
       private JTextField n1Text = new JTextField();
       private JTextField n2Text = new JTextField();
       private JTextField n3Text = new JTextField();
       private JTextField n4Text = new JTextField();
       private JTextField ansText = new JTextField();
    //Create text fields
       private JLabel Instructions = new JLabel("Enter number of acres for desired for each crop then press cost or reveune");
       private JLabel n1Label = new JLabel("Enter acres of soybeans here");
       private JLabel n2Label = new JLabel("Enter acres of corn here");
       private JLabel n3Label = new JLabel("Enter acres of potatos here");
       private JLabel n4Label = new JLabel("Enter acres of wheat here");
       private JLabel answerLabel = new JLabel("Total cost or revenue");
    //Create direction labels
       private JButton costButton = new JButton("cost");
       private JButton revenueButton = new JButton("revenue");
       private JButton profitButton = new JButton("profit");
       double sum;
       double n1;
       double n2;
       double n3;
       double n4;
    //Create buttons and declare double variables
       public void init()
          ansText.setEditable(false);
          JPanel content = new JPanel(new GridLayout(5, 2, 1, 1));
    //content.add(Instructions);
          content.add(n1Label);
          content.add(n1Text);
          content.add(n2Label);
          content.add(n2Text);
          content.add(n3Label);
          content.add(n3Text);
          content.add(n4Label);
          content.add(n4Text);
          content.add(answerLabel);
          content.add(ansText);
    //Add labels and input boxes
          JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
          buttonPanel.add(costButton);
          buttonPanel.add(revenueButton);
          buttonPanel.add(profitButton);
    //Add 3 calculation buttons
          add(content, BorderLayout.NORTH);
          add(buttonPanel, BorderLayout.SOUTH);
    //Button panel on bottom
          revenueButton.addActionListener(this);
          costButton.addActionListener(this);
          profitButton.addActionListener(this);
    //Make buttons listen
       public void actionPerformed(ActionEvent e)
          if (e.getActionCommand().equals("cost"))
             n1 = stringToDouble(n1Text.getText());
             n2 = stringToDouble(n2Text.getText());
             n3 = stringToDouble(n3Text.getText());
             n4 = stringToDouble(n4Text.getText());
             double totalCost = (n1 * 900) + (n2 * 100) + (n3 * 750) + (n4 * 800);
    //Calculate cost total
             ansText.setText(Double.toString(totalCost));
    //Write total to label
          else if (e.getActionCommand().equals("revenue"))
             n1 = stringToDouble(n1Text.getText());
             n2 = stringToDouble(n2Text.getText());
             n3 = stringToDouble(n2Text.getText());
             n4 = stringToDouble(n2Text.getText());
             double totalPrice = (n1 * 1300) + (n2 * 1650) + (n3 * 1200);
    //Calculate sell price total
             ansText.setText(Double.toString(totalPrice));
    //Write total to label
          else
             ansText.setText("Error");
       private static double stringToDouble(String stringObject)
          return Double.parseDouble(stringObject.trim());
    }

  • Files opening in unreadable code need help urgently please

    When I was given my new Toshiba laptop as a gift in 2007 Microsoft Office with Word and Excel etc were already set up so I do not have any discs or keycodes. .Being a senior person, it is also possible that my son who gifted it to me may have installed the above mentioned discs to help set me up, but he does not have any recollection of this, except that he gave me the Toshiba Recovery Disc which I do have.
    My laptop had to go back to Toshiba some time ago for a Manufacture- related issue. They also informed me that some of my files were corrupted. All features remained on my computer as prior to repair, so nothing was lost or had to be re-loaded.
    I have found that since then all my docs are opening in code form and are unreadable. Microsoft Word seems to have disappeared and I have had to install an old Microsoft Works 2001 disc in order to be able to work on new documents. Microsoft Onenote was on the disc but not Word, so the docs will not open with Onenote, so I am stuck.
    Is it possible for me to find out if Toshiba holds the keycode to my original Microsoft Office and would I be able to download it again.? I cannot afford to buy a full new Office system and I have no way of knowing which Microsoft Office ( 2007? )created the documents. I have to know if there is any way I can read these documents and also to establish which of them may be corrupted so that I can delete them. Would a system restore make the documents readable? I am very untechnical minded with regard to computers as you can observe from my wording and would really appreciate any help you can give as I cannot afford to pay someone who keeps my computer for a day or more and then charges me an extortionate amount.
    Thank you so much in advance if you can help me in any way with easy to follow instructions/advice.

    What is the model number of your laptop?
    A Trial version of MS Office may have been pre-installed. If you activated Office (Purchased a license), then you could try calling Microsoft to re-activate it.
    If you reinstall Windows using your Toshiba Recovery Disc, the Office installation should be installed. (Note that the Recovery Disc will delete your data, so back up your files first).
    Alternatively, you could use OpenOffice to read your documents. OpenOffice (free) works with Microsoft Office files.

  • Error in the following code.need help asap

    hi i have written a block which bulk collects into a pl/sql table.
    Getting an error as shown below.
    PLz help asap
    declare
    type summary_upd_tab is table of summary%rowtype;
    summary_upd_var summary_upd_tab;
    begin
    select
    min(a.start_time_utc),
    max(a.end_time_utc),
    sum(duration_seconds),
    sum(upload_bytes),
    sum(download_bytes)
    bulk collect into summary_upd_var ------GEETTING AN ERROR --TOO MANY VALUES???
    from aaa_sessions a
    group by user_id;
    ---,type_of_summary,ispeak;
    end;
    Edited by: user8731258 on Jul 20, 2010 10:16 PM

    i think the no. of columns should match(and that too in Order) else how will it know which value should go in which field of the collection ?

  • PIN Code Need Help on E51 SOS/F1 Help..!

    Hello guys...
    I want to change my pin code of my phone..
    Currently I'm using Nokia E51.
    I change the PIN Code Request to "Yes" and it asked the PIN code. And so where can i get that pin code? My phone is new one and I already try "12345" and "01234" but it didn't work. So, that means it already wrong 2 times. I was told that i can only wrong 3 times. is it right?
    If so, can u guys guide me or help me or any advice about where is that PIN Code????
    if i want to clear the timer of the call duration,etc. I just input "12345". Its ok and its work too. No other code...
    (But now I change my Lock Code from "12345" to something mix with letter and number) But in the PIN Code Request, i can only enter number. So i think PIN code Request code is not this lock code.
    So, can anyone guide me on this?
    Thanks

    The default pin code is set by your network so phone them and ask what it is.

  • ERROR MESSAGE HOW TO FIX need help

    Following are the messages I got after instal CS6 Design Standard.
    DF013 Failed to delete plist path at /library/Launchdaemons/com.adobe.switchboard.plist seq 20
    DW063 Another long failed message
    DW050 Payload errors during instrall
    DW050 adobe switchboard 2.0 instal failed
    DW050 Adobe minibridge failed instal
    What can I do to repair / fix the issue.
    APPARENTLY CUSTOMER CALL BACK FROM ADOBE DONT REALLY CALL YOU BACK. Wish I knew how to get thru to these people that ignore your request for help afteral its our money that gives them a job.
    PLEASE HELP
    Lee

    Lee747 there is not much actionable in your current post.  I would recommend you begin with reviewing the installation logs.  You can find complete steps on how to accomplish this at Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html.

  • [Have code] Need Help!!

    class JavaTest{
         public static void main(String[] arg){
              String str = "123 + 456";
              String arr[] = str.split(" ");
              arr[0] // 123
    arr[1] // +
    arr[2] // 456
    I want to output the ans which is 123+456 (579)
    How??
    if str = 45 - 45
    i would like it output 0

    public class QuickTest
         public static void main(String[] arg)
              String str = "123 + 456";
              String arr[] = str.split(" ");
              char operand = arr[1].charAt(0);
              int leftSide = Integer.parseInt(arr[0]);
              int rightSide = Integer.parseInt(arr[2]);
              int result = 0;
              switch (operand)
                   case '+':
                        result = leftSide + rightSide;
                        break;
                   case '-':
                        result = leftSide - rightSide;
                        break;
              System.out.println(result);
    }This code works, to an extent. You might want to add more 'case' statements to allow for * and /. Also, at the moment, if you put the initial string in as "123 * 34", the program would compile and run, and give the output 0. This is obviously wrong, so you might want to write code that checks for unexpected events.
    Just something to keep you going.......!

  • Logic Pro 8 & TDM Error Codes, need help!

    I am using Logic Pro 8 & TDM hardware. I am getting 2 error codes, only when I try to use the Audio Suite in the Sample Editor.
    "Error code -7401 was returned by the DAE driver."
    "2 times TDM error -7102 while trying to disconnect TDM."
    What do these mean? I tried searching the net and found nothing useful. Otherwise Logic Pro 8 and TDM has been flawless, and all my hardware works perfectly in Pro Tools HD.
    I am using a 96i I/O, and 1 Accel Core card and 2 HD Accel cards (PCIe).
    Also the Audio Suite doesn't seem to process the audio as intended or at all. There 2 errors show up when I try to preview the effect, no matter what Audio Suite buffer size I use.
    Thank you in advance for any info.

    I've been trying to get Logic to work with DAE/TDM in Leopard on a Mac Pro now for months! How did you do it?? Been searching the internet for answers ever since I started, and would highly appreciate your response.
    My most obvious problems are: No audio from Aux (EXS, ESB) or instruments. The whole program is "struggling" with awful "framerates" . . just moving the pointer takes forever.
    When in Core-audio everything works fine.
    I have reinstalled Leopard, Pro Tools and Logic several times, with no luck.
    Please tell me how you did it!
    Thx in advance!!
    /K

  • DReamweaver code need help

    Hi,
    this morning when im checking one of my sites i got this for
    both design and code view and when viewed in a browser:
    $|r4øs‚ßB9¬ã*…SúEÏ1°~´
    ’j¿¨Ú!¶Fÿð{„XøËå™ùïiZÈ
    [Š¦šçKŁêÐmi˜—bQ¨EPéÙ¼Š06v–Ém4
    U0ï#¿ü‹ÔäG™j0ŸEWØ/Òä@G^õ×-€”f'ná7lÓÅïvráÃ%‚ÈÕ¸ˆÜåp`CµúÚ]‘Nò‰¿áp~#Š‹nàz2Åbn©z‰§•´nW¦åØ
    *·ø¯‡q-ˆ¹=&õ?võX0̉PJãá!=€ZF›üxŠ+‹·ç'ØÎÕvžh¸.ÂĦ>è4òdYæ
    9¥®ü.îÒeÿ5O@j`Ï;Eoj–a–†C»*eše¬=è_9¼2»#¨p”˜ç‰1mGÇY›ùƒð)ô›ëµä:ƒÔ‘Ï|&3¥]ɼռ&ÅÍvсäùlÕ¾-®¿§ Dî™8GvȁP]Ô[¥;›#‘–þ²‹ï
    jýq²Î5‰…J)?QŬ_-ŒqÀiºZ5#Ûóc¦ë$Kœ=د:X²µÆ>¸Áögí^š,.f‚áùÊ1:gDv}´Ìþ-Õˆg;·‰è²rQi‰kíFÌgVÜŸõ@Š ÕËæÞª¹JÉk¨}òA§Œ«ÛÉîò‰"½»ò1àûL
    ºŽ‡„E8Ïi.ÊZ
    kX`Ö\ž¼ú_ˆë1É„`¿P3Æ�
    nÏ>W?VœØ|âú7deg°\åÉú0³÷›ÝÌÈB‡6Éy<azúðëÎæKOÏ+øá½ð¼4\€¶Ol6R^
    ã!Œ6…ÝX&s
    ·þši¬^e^OÕñÆùdnâEªdL\©µÕD‰Ét8àcãŽ,U#pN]{™éæ$˱`Ì£ÿç{õ#‹0ù¿O׿•ü|çÑvûµ~¶¸¸-¢ËÓO˜Nüý©Pž C¡zƒ¦~C™\Ò*-†¾òÇ8v„P-8µZœD£ÍÁSYkšHüþÒé+¼Ë{íÆʘVä×'
    hX¡4‹>
    That does not look like html to me.
    I've been working with dreamweaver for quite a while, and
    this a first time i've seen this.
    What could have caused this? corrupt files? Yesterday my web
    pages looked fine.

    Can you post a link to the page? What language is it in?
    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
    ==================
    "Sweet_16" <[email protected]> wrote in
    message
    news:e6ml72$hq9$[email protected]..
    > Hi,
    >
    > this morning when im checking one of my sites i got this
    for both design
    > and
    > code view and when viewed in a browser:
    >
    > $|r4?s??B9??*?S?E?1?~? ?j????!?F??{?X??????iZ?
    >
    > [????K????mi??bQ?EP????06v??m4 U0?#?????G?j0?EW??/??@G^
    ??-??f'n?7l
    > ???vr???
    > %???????p`C???]?N????p~#??n?z2?bn?z?????nW???
    >
    *????q-??=&??v?X0???PJ??!=?ZF??x?+???'???v?h?.????>?4?dY?
    >
    9???.??e?5?O@j`?;Eoj?a??C?*e?e?=?_9?2?#?p????1mG?Y????)?????:????|&3?]
    > ????&??v????l??-???D??8Gva??P]?[?;?#??????
    >
    j?q??5??J)?Q??_-?q?i?Z5#??c??$K?=??:X???>????g?^?,.f????1:gDv}???-??
    >
    g;????rQi?k?F?gV???@???????J?k??}?A????????"???1??L
    > ????E8?i.?Z
    >
    > kX`?\???_??1??`?P3??
    > n?>W?V??|??7deg??\???0??????B?6?y<az??????KO?+??
    > ???4\??Ol6R^ ?!?6??X&s
    >
    >
    ???i?^e^O?????dn?E?dL\???D??t8?c??,U??#pN]{???$??`????{?#?0??O????|
    >
    ??v???~???-???O?N???P?C?z??~C?\?*-????8v?P-8?Z?D???SYk?H????+??{???
    > ?V??'
    > hX?4?>
    >
    > That does not look like html to me.
    > I've been working with dreamweaver for quite a while,
    and this a first
    > time
    > i've seen this.
    > What could have caused this? corrupt files? Yesterday my
    web pages looked
    > fine.
    >

  • Itune card invalid code need help

    what am i doing wrong. I enter my itune card. so when i go purchase a song. a pop up box appears saying review your account. I do that and asking me to enter my itune card which is say invalid code.

    Is the address on your iTunes account exactly the same (format and spacing etc) as on your credit card bill : http://support.apple.com/kb/TS1646 ? If it is and your bank has confirmed that they don't use any other info to authorise payments on your card, then try contacting iTunes support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • Need help on how to add a delimeter into a text file

    Actually, this program reads a textfile. After reading, i need to put certain delimeters after certain characters and print them out to a new file.
    this is how it works :
    for example...
    471117-01-5179052004 VENUE SECURITIES SDN. BHD.
    This is wat the programs read. Now i have to put a semicolon after this numbers ..
    471117-01-5179052004 (;)
    then put another semiclon after this words
    VENUE SECURITIES SDN. BHD.(;)
    But, this text file contains around 2000 lines, and i have to do this for each line...thts y i dunt understand how to code it.

    thanks mr. micheal dunn. Anyway, how can i put this code to read from a text file.....because i need to read the whole text line and put semicolons. i cant use stringbuffer as it only reads a certain length of string..could u tell me how to do this.
    this line is actaully a short line from the text file.
    String str = "471117-01-5179052004 VENUE SECURITIES SDN. BHD.";
    need to put the semicolon is this line actually :
    471117-01-5179052004(;)AVENUE SECURITIES SDN.BHD. (;)000350785A (;)RAHMAN BIN KADIRAN 51, TAMAN MUHIBBAH SUNGAI MATI MUAR 84400(;)JMY(;)SMYSBI (;) 8516 000000030000004600 (;)1581800 ...can u explain wat is tht \\d+-..sorry im a beginner here...hope u can help me out..

  • Warning this is very long code but i need help to see if I am on right trac

    I have done all the following code myself and it is the buisiness layer for my application. I have tried to follow recommendations on previous posts and I would like to be told where I can clean up my code and how? This is not complete and it looks very long to me but I need help in order to be better. There are 4 button vlivks and I have not completed them all. The criteria for application is that phonebook will accept new entries if they have names surnames and phone numbers that are not longer than 10 characters for display purposes but can change this. No duplicates are allowed. No editing of a existing entry must lead to a duplicate entry either. No new entry or edit may result in a new contact having no phone numbers.
    Many thanks for your time in advance,.....
    import javax.swing.JOptionPane;
    import java.util.ArrayList;
    public class Contact
    {// Start of the Contact class
         ArrayList<ContactDetails> phoneList = new ArrayList<ContactDetails>();          // To hold all the contacts
         ArrayList<ContactDetails> searchList = new ArrayList<ContactDetails>();          // To hold all contacts that return true on search
         ArrayList<ContactDetails> list = new ArrayList<ContactDetails>();
         String newName;                                                                                // To hold the new name
         String newSurname;                                                                           // to hold the new surname
         String newHome;                                                                                // To hold the new home number if any
         String newWork;                                                                                // To hold the new work number
         String newCell;                                                                                // To hold the new cell number
         final int MAX_LENGTH = 10;
         public boolean addToPhoneList;                                                            // Sets to false if there is an invalid entry
         public boolean addToSearchList;                                                            // Sets to false if there is an invlid search
         public boolean modifyContact;                                                            // Sets to false if there is an invalid modification
         // Method to create a new contact
         public void createNew()
         {// Start of create new()
              addToPhoneList = true;                                                                 // Set boolean to true each time the method is executed
              getNewContactsName();                                                                 // Get new name
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsSurname();                                                            //Get new surname
              if(addToPhoneList == false)
                   createNew();
                   return;
              String checkName = newName;                                                            //Creates copies to be used in the checkIfDuplicate method
              String checkSurname = newSurname;
              addToPhoneList = checkIfDuplicate(checkName, checkSurname);                    //Check if the entries are duplicate
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsHomeNum();                                                            // Get new home number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsWorkNum();                                                            // Get new work number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsCellNum();                                                            // Get new cell number
              if(addToPhoneList == false)
                   createNew();
                   return;
              checkAtLeastOneNumEntered();                                                       // Check that at least one phone number was entered
              if(addToPhoneList == true)
                   updateListWithNew();
         }// End of createNew()
         // Method to search for an existing contact
         public void searchExisting()
         {// Start of searchExisting()
              addToSearchList = true;                                                                 // Set the boolean true
              searchList.clear();                                                                      // Clear list from any previous searches
              if(phoneList.size() > 0)                                                            // Check if any contacts are in the list
                   getExistingDetailsAndSearch();                                                  // If there are entries then continue to search
              else
                   JOptionPane.showMessageDialog(null,"There are no contacts to search for. Please use this option when you have added a contact to the list.","Error",JOptionPane.ERROR_MESSAGE);
         }// End of searchExisting()
         // Method to modify an existing contact
         public void modifyExisting()
         {// Start of modifyExisting()
              modifyContact = true;                                                                 // Set the boolean to true
              if(phoneList.size() <= 0)                                                            // Check if the phonelist is not empty
                   JOptionPane.showMessageDialog(null,"There are no contacts to modify. Please use this option when there have been contacts added to the list.","Error",JOptionPane.ERROR_MESSAGE);
              else
                   getExistingDetailsAndModify();                                                  // If phonelist not emty continue to modify method
         }// End of modifyExisting()
         //Method to delete a contact from the list
         public void deleteExisting()
         //Method to get new contacts name
         public void getNewContactsName()
              newName = JOptionPane.showInputDialog("Please enter the new contacts name or press cancel to exit without saving.");
              if(newName == null)
                   finish();
              if(newName.trim().length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
                   return;
              addToPhoneList = checkLengthValid(newName, "name");
         //Method to get a new contacts surname
         public void getNewContactsSurname()
              newSurname = JOptionPane.showInputDialog("Please enter the new contacts surnname or press cancel to exit without saving.");
              if(newSurname == null)
                   finish();
              addToPhoneList = checkLengthValid(newSurname, "surname");
         //Method to get a new contacts home number
         public void getNewContactsHomeNum()
              newHome = JOptionPane.showInputDialog("Please enter the new contacts home number or press cancel to exit without saving.");
              if(newHome == null)
                   finish();
              if(newHome.trim().length() > 0)
                   try
                        Long homeNum = Long.parseLong(newHome);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid phone number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newHome, "home number");
         //Method to get a new contacst work number
         public void getNewContactsWorkNum()
              newWork = JOptionPane.showInputDialog("Please enter the new contacts work number or press cancel to exit without saving");
              if(newWork == null)
                   finish();
              if(newWork.trim().length()> 0)
                   try
                        Long workNum = Long.parseLong(newWork);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newWork, "work number");
         //Method to get a new contacts cell number
         public void getNewContactsCellNum()
              newCell = JOptionPane.showInputDialog("Please enter the new contacts cell number or press cancel to exit without saving");
              if(newCell == null)
                   finish();
              if(newCell.trim().length() > 0)
                   try
                        Long cellNum = Long.parseLong(newCell);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newCell, "cell number");
         //Method to get the details for an existing contact
         public void getExistingDetailsAndSearch()
              String existingName = getExistingName("search for");
              if(existingName == null)
                   addToSearchList = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   addToSearchList = false;
                   searchExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(addToSearchList == true)
                   searchAndAddIfFound(existingName, existingSurname);
         //Method to get existing details and modify contact
         public void getExistingDetailsAndModify()
              String existingName = getExistingName("modify");
              if(existingName == null)
                   modifyContact = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   modifyExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(modifyContact == true)
                   getContactBySearch(existingName.trim().toUpperCase(), existingSurname.trim().toUpperCase());
         //Method to get the contact from list and modify details
         public void getContactBySearch(String currentName, String currentSurname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if((cd.name.equals(currentName))&&(cd.surname.equals(currentSurname)))
                        numFound ++;
                        changeDetails(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts matching the name and surname you entered found. Press the modify button to try again.","Information",JOptionPane.INFORMATION_MESSAGE);
         //Method to get existing contacts name
         public String getExistingName(String whatWasClicked)
              String name = JOptionPane.showInputDialog("Please enter the contacts name that you wish to "+whatWasClicked);
              return name;
         //Method to get an existing contacts surname
         public String getExistingSurname()
              String surname = JOptionPane.showInputDialog("Please enter the contacts surname.");
              return surname;
         //Method to change the details of contact
         public void changeDetails(ContactDetails conToChange)
              String currentName = conToChange.name;
              String currentSurname = conToChange.surname;
              String currentHome = conToChange.home;
              String currentWork = conToChange.work;
              String currentCell = conToChange.cell;
              String newNameForContact = getNewModName(currentName);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newSurnameForContact = getNewModSurname(currentSurname);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newHomeForContact = getNewModHome(currentHome);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newWorkForContact = getNewModWork(currentWork);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newCellForContact = getNewModCell(currentCell);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              if(modifyContact == true)
                   conToChange.name = newNameForContact;
         //Method to get the modified name
         public String getNewModName(String currentName)
              String newModifiedName = JOptionPane.showInputDialog("Please enter the new name for contact or press cancel to keep it as is.");
              if(newModifiedName == null)
                   return currentName;
              if(newModifiedName.trim().length() <= 0)
                   JOptionPane.showMessageDialog(null,"You may not replace the existing name with a blank name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   return currentName;
              modifyContact = checkLengthValid(newModifiedName, "modified name");
              return newModifiedName;
         //Method to get the modified surname
         public String getNewModSurname(String currentSurname)
              String newModifiedSurname = JOptionPane.showInputDialog("Please enter the new surname for the contact or press cancel to keep it as is.");
              if(newModifiedSurname == null)
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              if(modifyContact == false)
                   JOptionPane.showMessageDialog(null,"Surname not changed.","Information",JOptionPane.INFORMATION_MESSAGE);
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              return newModifiedSurname;
         //Method to search and update the list with a succesfull search
         private void searchAndAddIfFound(String name, String surname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if(cd.name.equals(name.trim().toUpperCase()))
                        numFound ++;
                        searchList.add(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts were found matching the dat you entered.","Information",JOptionPane.INFORMATION_MESSAGE);
              else
                   list.clear();
                   list.addAll(searchList);
         //Method that check all entries are a valid logical length
         //Method is based on assumption that a normal name, surname, and phone numbers are not longer than 10 characters long.
         //IF This method is changed please change the layout in the GUI as this is also set to fit with the layout that gives a neat //apperance
         private boolean checkLengthValid(String detailEntered, String whatWasEntered)
              boolean validLength = true;
              if(detailEntered.trim().length() >= MAX_LENGTH)
                   JOptionPane.showMessageDialog(null,"The " +whatWasEntered+" you entered is too long. Please try again and use a "+whatWasEntered+" that is less than "+MAX_LENGTH+" characters long.","Error",JOptionPane.ERROR_MESSAGE);
                   validLength = false;
              return validLength;
         private void finish()
              System.exit(0);
         //Method to update the list with a new entry
         private void updateListWithNew()
              try
                   ContactDetails cd = new ContactDetails();
                   cd.name = newName.trim().toUpperCase();
                   cd.surname = newSurname.trim().toUpperCase();
                   cd.home = newHome.trim();
                   cd.work = newWork.trim();
                   cd.cell = newCell.trim();
                   phoneList.add(cd);
                   JOptionPane.showMessageDialog(null,"Contact succesfully entered. To save this change press exit to save or use the save option in the toolbar menu.","Information",JOptionPane.INFORMATION_MESSAGE);
              catch(Exception e)
                   JOptionPane.showMessageDialog(null,"Failed to add contact to list. If problem persists please contact the software developer.","Error",JOptionPane.ERROR_MESSAGE);
              list.clear();
              list.addAll(phoneList);
         //Method to check for duplicate
         public boolean  checkIfDuplicate(String nameToCheck, String surnameToCheck)
              int count = 0;
              boolean valid = true;
              for(ContactDetails cd : phoneList)
                   cd = phoneList.get(count);
                   if(((nameToCheck.trim().toUpperCase()).equals(cd.name))&&((surnameToCheck.trim().toUpperCase()).equals(cd.surname)))
                        JOptionPane.showMessageDialog(null,"You may not enter a duplicate contact. Please try again and change the name and surname.","Error",JOptionPane.ERROR_MESSAGE);
                        valid = false;
                        break;
                   count ++;
              return valid;
         //Method to check that at least one phone number exists for contact
         public void checkAtLeastOneNumEntered()
              if((newHome.trim().length()<=0)&&(newWork.trim().length()<=0)&&(newCell.trim().length()<=0))
                   JOptionPane.showMessageDialog(null,"You have not entered any phone number at all. You must enter at least one phone number for a new contact.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
         //Method that returns the list to the GUI
         public ArrayList<ContactDetails> getList()
              return list;
    }

    Should I start over from scratch? Can I get help with links to tutorials on following? How to create a java CRUD application (google not useful) and how to layer in java(google not useful)
    This is my pres layer as is is this wrong too?
         Filename:     ContactsListInterface.java
         Date:           16 March 2008
         Programmer:     Yucca Nel
         Purpose:     Provides a GUI for entering names and contact numbers into a telephone directory.
                        Also allows options for searching for a specific name and deleting of data from the record
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Phonebook1 extends JFrame implements ActionListener
    { //start of class
         // construct fields, buttons, labels,text boxes, ArrayLists etc
         JTextPane displayPane = new JTextPane();
         JLabel listOfContacts = new JLabel("List Of Contacts");               // creates a label for the scrollpane
         JButton createButton = new JButton("Create");
         JButton searchButton = new JButton("Search");
         JButton modifyButton = new JButton("Modify");
         JButton deleteButton = new JButton("Delete");
         Contact c = new Contact();
         ArrayList<ContactDetails> contactList = c.getList();
         // create an instance of the ContactsListInterface
         public Phonebook1()
         { // start of cli()
              super("Phonebook Interface");
         } // end of cli()
         public JMenuBar createMenuBar()
         { // start of the createMenuBar()
              // construct and populate a menu bar
              JMenuBar mnuBar = new JMenuBar();                              // creates a menu bar
              setJMenuBar(mnuBar);
              JMenu mnuFile = new JMenu("File",true);                         // creates a file menu in the menu bar which is visible
                   mnuFile.setMnemonic(KeyEvent.VK_F);
                   mnuFile.setDisplayedMnemonicIndex(0);
                   mnuFile.setToolTipText("File Options");
                   mnuBar.add(mnuFile);
              JMenuItem mnuFileExit = new JMenuItem("Save And Exit");     // creates an exit option in the file menu
                   mnuFileExit.setMnemonic(KeyEvent.VK_X);
                   mnuFileExit.setDisplayedMnemonicIndex(1);
                   mnuFileExit.setToolTipText("Close Application");
                   mnuFile.add(mnuFileExit);
                   mnuFileExit.setActionCommand("Exit");
                   mnuFileExit.addActionListener(this);
              JMenu mnuEdit = new JMenu("Edit",true);                         // creates a menu for editing options
                   mnuEdit.setMnemonic(KeyEvent.VK_E);
                   mnuEdit.setDisplayedMnemonicIndex(0);
                   mnuEdit.setToolTipText("Edit Options");
                   mnuBar.add(mnuEdit);
              JMenu mnuEditSort = new JMenu("Sort",true);                    // creates an option for sorting entries
                   mnuEditSort.setMnemonic(KeyEvent.VK_S);
                   mnuEditSort.setDisplayedMnemonicIndex(0);
                   mnuEdit.add(mnuEditSort);
              JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name");          // to sort entries by name
                   mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
                   mnuEditSortByName.setDisplayedMnemonicIndex(8);
                   mnuEditSortByName.setToolTipText("Sort entries by first name");
                   mnuEditSortByName.setActionCommand("Name");
                   mnuEditSortByName.addActionListener(this);
                   mnuEditSort.add(mnuEditSortByName);
              JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname");     // to sort entries by surname
                   mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
                   mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
                   mnuEditSortBySurname.setToolTipText("Sort entries by surname");
                   mnuEditSortBySurname.setActionCommand("Surname");
                   mnuEditSortBySurname.addActionListener(this);
                   mnuEditSort.add(mnuEditSortBySurname);
              JMenu mnuHelp = new JMenu("Help",true);                                        // creates a menu for help options
                   mnuHelp.setMnemonic(KeyEvent.VK_H);
                   mnuHelp.setDisplayedMnemonicIndex(0);
                   mnuHelp.setToolTipText("Help options");
                   mnuBar.add(mnuHelp);
              JMenuItem mnuHelpHelp = new JMenuItem("Help");                              // creates a help option for help topic
                   mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
                   mnuHelpHelp.setDisplayedMnemonicIndex(3);
                   mnuHelpHelp.setToolTipText("Help Topic");
                   mnuHelpHelp.setActionCommand("Help");
                   mnuHelpHelp.addActionListener(this);
                   mnuHelp.add(mnuHelpHelp);
              JMenuItem mnuHelpAbout = new JMenuItem("About");                         // creates a about option for info about api
                   mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
                   mnuHelpAbout.setDisplayedMnemonicIndex(4);
                   mnuHelpAbout.setToolTipText("About this program");
                   mnuHelpAbout.setActionCommand("About");
                   mnuHelpAbout.addActionListener(this);
                   mnuHelp.add(mnuHelpAbout);
              return mnuBar;
         } // end of the createMenuBar()
         // create the content pane
         public Container createContentPane()
         { // start of createContentPane()
              //construct and populate panels and content pane
              JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
                   labelPanel.setLayout(new FlowLayout());
                   labelPanel.add(listOfContacts);
              JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
                   setTabsAndStyles(displayPane);
                   displayPane = addTextToTextPane();
                   displayPane.setEditable(false);
              JScrollPane scrollPane = new JScrollPane(displayPane);
                   scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
                   scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
                   scrollPane.setPreferredSize(new Dimension(400,320));
              displayPanel.add(scrollPane);
              JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
                   workPanel.setLayout(new FlowLayout());
                   workPanel.add(createButton);
                        createButton.setToolTipText("Create a new entry");
                        createButton.addActionListener(this);
                   workPanel.add(searchButton);
                        searchButton.setToolTipText("Search for an entry by name number or surname");
                        searchButton.addActionListener(this);
                   workPanel.add(modifyButton);
                        modifyButton.setToolTipText("Modify an existing entry");
                        modifyButton.addActionListener(this);
                   workPanel.add(deleteButton);
                        deleteButton.setToolTipText("Delete an existing entry");
                        deleteButton.addActionListener(this);
              labelPanel.setBackground(Color.red);
              displayPanel.setBackground(Color.red);
              workPanel.setBackground(Color.red);
              // create container and set attributes
              Container c = getContentPane();
                   c.setLayout(new BorderLayout(30,30));
                   c.add(labelPanel,BorderLayout.NORTH);
                   c.add(displayPanel,BorderLayout.CENTER);
                   c.add(workPanel,BorderLayout.SOUTH);
                   c.setBackground(Color.red);
              // add a listener for the window closing and save
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                             int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
                             if(answer == JOptionPane.YES_OPTION)
                                  System.exit(0);
              return c;
         } // end of createContentPane()
         protected void setTabsAndStyles(JTextPane displayPane)
         { // Start of setTabsAndStyles()
              // set Font style
              Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
              Style regular = displayPane.addStyle("regular", fontStyle);
              StyleConstants.setFontFamily(fontStyle, "SansSerif");
              Style s = displayPane.addStyle("bold", regular);
              StyleConstants.setBold(s,true);
         } // End of setTabsAndStyles()
         public JTextPane addTextToTextPane()
         { // start of addTextToTextPane()
              int numberOfEntries = contactList.size();
              int count = 0;
              Document doc = displayPane.getDocument();
              try
              { // start of tryblock
                   // clear previous text
                   doc.remove(0,doc.getLength());
                   // insert titles of columns
                   doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
                   for(ContactDetails cd : contactList)
                        cd = contactList.get(count);
                        doc.insertString(doc.getLength(),cd.name+"\t"+cd.surname+"\t"+cd.home+"\t"+cd.work+"\t"+cd.cell+"\n",displayPane.getStyle("regular"));
                        count ++;
              } // end of try block
              catch(BadLocationException ble)
              { // start of ble exception handler
                   System.err.println("Could not insert text.");
              } // end of ble exception handler
              return displayPane;
         } // end of addTextToTextPane()
         // code to process user clicks
         public void actionPerformed(ActionEvent e)
         { // start of actionPerformed()
              String arg = e.getActionCommand();
              // user clicks create button
              if(arg.equals("Create"))
                   c.createNew();                                                  // method to create a new Contact
                   addTextToTextPane();
              if(arg.equals("Search"))
                   c.searchExisting();                                             // method to search for an existing entry
                   addTextToTextPane();
              if(arg.equals("Modify"))
                   c.modifyExisting();                                             // method to modify contact
                   addTextToTextPane();
              if(arg.equals("Delete"))
                   c.deleteExisting();
                   addTextToTextPane();
              if(arg.equals("Exit"))
         } // end of actionPerformed()
         // method to create a new contact
         public static void main(String[] args)
         { // start of main()
              // Set look and feel of interface
              try
              { // start of try block
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } // end of try block
              catch(Exception e)
              { // start of catch block
                   JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
              } // end  of catch block
              Phonebook1 pb = new Phonebook1();
              pb.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              pb.setJMenuBar(pb.createMenuBar());
              pb.setContentPane(pb.createContentPane());
              pb.setSize(520,500);
              pb.setVisible(true);
              pb.setResizable(false);
         } // end of main()
    } //end of class

  • Need help on how to do this :

    This might be a little off topic, but since it
    invovles a cf app, I thought I would post here for
    help.
    The problem I am having seems simple enough, but I cannot get
    it to work.
    My form contains two radio buttons and two input
    fields.
    Button 1 corresponds to field 1 and button 2
    corresonpds to field 2.
    One of the buttons must be select and I have
    javascript to check for that. Now here is my problem :
    If button 1 is selected, then field 1 must be filled
    in, and if button 2 is selected, then field 2 must be
    filled in.
    I have javascript to check for entries in the fields,
    but I cannot seem to combine both together to get them
    to work.
    So if they attempt to submit without checking one of
    the buttons, I display an error message. If they check
    button 1 and do not fill in field 1 and attempt to
    submit, then I need to display an alert (error
    message), same for button 2 and field 2.
    Can someone please help and show me how to do this ?
    Thanks

    quote:
    Originally posted by:
    trojnfn
    Can somebody please help me with this ?
    Writing down the requirements in english is a good way to go
    about it. Reading your first post I would understand your
    requirements to be
    1. if they attempt to submit without checking one of the
    buttons, I display an error message.
    2. If they check button 1 and do not fill in field 1 and
    attempt to submit, then I need to display an alert (error
    message)
    3. Repeat #2 for button 2 and field 2
    In psuedo-code that might translate to
    if (neither button is checked) {
    display error message
    else if (button1 is checked and field1 is empty) {
    display an error message
    else if (button2 is checked and field2 is empty) {
    display an error message
    else {
    everything is okay. submit the form
    Then translate that into javascript. The code needs some
    extra work like trimming values, but its a good starting point.
    I'll leave the rest up to you.
    <script language="javascript">
    // code assumes your form fields have the unique id's
    'button1' , 'button2' , 'field1', 'field2'.
    function validateForm(buyer_form) {
    //determine if buttons 1 and 2 are checked
    var isButton1Checked =
    document.getElementById('button1').checked;
    var isButton2Checked =
    document.getElementById('button2').checked;
    //get the values of fields 1 and 2
    var field1Value = document.getElementById('field1').value;
    var field2Value = document.getElementById('field2').value;
    //if neither button is checked
    if (!isButton1Checked && !isButton2Checked) {
    alert("Please Indicate whether you wish to send a NOR letter
    to this supplier, or not");
    //if button 1 is checked but field 1 is empty
    else if (isButton1Checked && field1Value == "") {
    alert("When button 1 is checked, you must enter a value in
    Field 1");
    //if button 2 is checked but field 2 is empty
    else if (isButton2Checked && field2Value == "") {
    alert("When button 2 is checked, you must enter a value in
    Field 2");
    //if okay, submit the form
    else {
    buyer_form.submit();
    </script>
    If you haven't already, you should familiarize yourself with
    DOM javascript. Elements should have a unique ID so they can be
    accessed using:
    document.getElementById('theIDOfTheElementYouWant'); Note, element
    ID is not the same as "name".
    http://www.w3schools.com/htmldom/met_doc_getelementbyid.asp

  • Need help: How to key in input array, save in a buffer, and extract them later?

    Hi, I need help. I have several groups of data for input, and need to use them later in the same or different code. When I key in the input data, the code will ask the number of data group first, then in each group, there will be 6 data to key in, each has a specific variable name. The number of group and the data for each group will vary at each time running the code. The data group needs to be numbered sequently. After having all groups of data, these data will be sent to another sub VI to read. This sub VI needs to know each group number and each data of a group.
    I think I should create a 2-D array to read these data in a do loop, but I can't let my do loop read data in each time. Then when I sent the data out, the next sub VI was confused by the sequence of the data group and the sequence of data in each group. Can someone help me or give me some example how to do it? Thank you very much for your help.
    Message Edited by ccyang on 06-06-2006 10:37 AM

    From what I understand of your explanation, an event structure might be
    the way to go (LV 6+ I think).  Events could be based off of
    keypresses in a particular control (a 2D array like you mentioned), and
    once input in that particular field is complete, the user presses say
    the 'enter' key, and you can use the "VKey" of the event data node to
    determine which key is pressed (i.e. VKey = enter?).  From there,
    you would continue to the next portion of data entry or processing of
    entered information.
    Hope this helps.

Maybe you are looking for