Need help with a popup window problem

I have this code within my certAppB.js page :
function AppSubmit() {
     str1 = "Submitting this form will begin the approval process.";
     str2 = "You will not be able to come back to this form to edit it again.";
     str3 = "Do you want to continue submitting this form?";
     if((confirm(str1 + "\n" + str2 + "\n" + str3))){
          document.forms[0].status.value="Submitted";
          document.forms[0].submit();
Which produces a popup windows that says:
Submitting this form will begin the approval process
You will not be able to come back to this form to edit it again
Do you want to continue submitting this form?
OK Cancel (these are 2 buttons)
I want to change this to say:
Submitting this form will begin the approval process. You will not be able to change this form once submitted. You also agree that the following statement is true and correct to the best of your knowledge and belief:
"I, [User Name], hereby certify and state on behalf of [Company Name] that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.�6314, as applicable, including authorized waivers, as they currently exist on [Date]."
Do you want to continue submitting this form?
OK           Cancel
So I have to pull the users [User Name], [Company Name], and the [Date].
On the approverView.jsp login page ( which is the first login page users see after loggin) it shows
the users full name, so I nabbed the code from that page:
<body>
<jsp:include page="logo.jsp" />
<jsp:include page="unav-navigate.jsp" />
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="info">
<tr>
<td width="25%" valign="top">
<logic:present name="UserContainer" property="userView" scope="session">
<span class="welcome">Welcome
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<span class="sm">If you are not this person, please click <html:link styleClass="norm" href="/fake_name/logoff.do">here</html:link>.</span></td>
<td width="2%"> </td>
<td width="73%" valign="top"><jsp:include page="instruction.jsp" /></td>
</tr>
</table>
and made this code out of it to pull the username,companyname:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<logic:present name="UserContainer" property="userView" scope="session">
<span class="Company">Company
     <bean:write name="UserContainer" property="userView.companyName" scope="session"/>
!</span><br>
</logic:present>
This is the userView.java page that is referanced :
* Created on Mar 28, 2003
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
package org.fake.name.view;
import java.io.Serializable;
import java.util.List;
import org.gama.cafs.businessobjects.TorqueDb;
* @author chris
public class UserView implements Serializable {
     private int userId;
     private int memberId;
     private int companyId;
     private String role;
     private String firstName;
     private String lastName;
     private String companyTitle;
     private String emailAddress;
     private String phoneNumber;
     private String companyName;
     private String address1;
     private String address2;
     private String address3;
     private String city;
     private String state;
     private String province;
     private String postalCode;
     private String countryName;
     private List productTypes = null;
     private List productTypeAcronyms = null;
     private List productTypeIds = null;
     private List tradeNameIds = null;
     private List tradeNames = null;
     private TorqueDb torqueDb = null;
     public UserView() { }
     * @return String
     public String getAddress1() {
          return address1;
     * @return String
     public String getAddress2() {
          return address2;
     * @return String
     public String getAddress3() {
          return address3;
     * @return String
     public String getCity() {
          return city;
     * @return String
     public String getCompanyName() {
          return companyName;
     * @return String
     public String getCompanyTitle() {
          return companyTitle;
     * @return String
     public String getCountryName() {
          return countryName;
     * @return String
     public String getEmailAddress() {
          return emailAddress;
     * @return String
     public String getFirstName() {
          return firstName;
     * @return String
     public String getLastName() {
          return lastName;
     * @return int
     public int getMemberId() {
          return memberId;
     * @return String
     public String getPhoneNumber() {
          return phoneNumber;
     * @return String
     public String getPostalCode() {
          return postalCode;
     * @return Set
     public List getProductTypes() {
          return productTypes;
     * @return String
     public String getProvince() {
          return province;
     * @return String
     public String getRole() {
          return role;
     * @return String
     public String getState() {
          return state;
     * @return int
     public int getUserId() {
          return userId;
     * Sets the address1.
     * @param address1 The address1 to set
     public void setAddress1(String address1) {
          this.address1 = trimString(address1);
     * Sets the address2.
     * @param address2 The address2 to set
     public void setAddress2(String address2) {
          this.address2 = trimString(address2);
     * Sets the address3.
     * @param address3 The address3 to set
     public void setAddress3(String address3) {
          this.address3 = trimString(address3);
     * Sets the city.
     * @param city The city to set
     public void setCity(String city) {
          this.city = trimString(city);
     * Sets the companyName.
     * @param companyName The companyName to set
     public void setCompanyName(String companyName) {
          this.companyName = trimString(companyName);
     * Sets the companyTitle.
     * @param companyTitle The companyTitle to set
     public void setCompanyTitle(String companyTitle) {
          this.companyTitle = trimString(companyTitle);
     * Sets the countryName.
     * @param countryName The countryName to set
     public void setCountryName(String countryName) {
          this.countryName = trimString(countryName);
     * Sets the emailAddress.
     * @param emailAddress The emailAddress to set
     public void setEmailAddress(String emailAddress) {
          this.emailAddress = trimString(emailAddress);
     * Sets the firstName.
     * @param firstName The firstName to set
     public void setFirstName(String firstName) {
          this.firstName = trimString(firstName);
     * Sets the lastName.
     * @param lastName The lastName to set
     public void setLastName(String lastName) {
          this.lastName = trimString(lastName);
     * Sets the memberId.
     * @param memberId The memberId to set
     public void setMemberId(int memberId) {
          this.memberId = memberId;
     * Sets the phoneNumber.
     * @param phoneNumber The phoneNumber to set
     public void setPhoneNumber(String phoneNumber) {
          this.phoneNumber = trimString(phoneNumber);
     * Sets the postalCode.
     * @param postalCode The postalCode to set
     public void setPostalCode(String postalCode) {
          this.postalCode = trimString(postalCode);
     * Sets the productTypes.
     * @param productTypes The productTypes to set
     public void setProductTypes(List productTypes) {
          this.productTypes = productTypes;
     * Sets the province.
     * @param province The province to set
     public void setProvince(String province) {
          this.province = trimString(province);
     * Sets the role.
     * @param role The role to set
     public void setRole(String role) {
          this.role = trimString(role);
     * Sets the state.
     * @param state The state to set
     public void setState(String state) {
          this.state = trimString(state);
     * Sets the userId.
     * @param userId The userId to set
     public void setUserId(int userId) {
          this.userId = userId;
     * @return List
     public List getProductTypeAcronyms() {
          return productTypeAcronyms;
     * Sets the productTypeIds.
     * @param productTypeIds The productTypeIds to set
     public void setProductTypeAcronyms(List productTypeAcronyms) {
          this.productTypeAcronyms = productTypeAcronyms;
     public List getProductTypeIds() {
          return productTypeIds;
     public void setProductTypeIds(List productTypeIds) {
          this.productTypeIds = productTypeIds;
     private String trimString(String str) {
          String tmp = null;
          if (str != null)
               tmp = str.trim();
          else
               tmp = str;
          return tmp;
     public List getTradeNameIds() {
          return tradeNameIds;
     public List getTradeNames() {
          return tradeNames;
     public void setTradeNameIds(List list) {
          tradeNameIds = list;
     public void setTradeNames(List list) {
          tradeNames = list;
     public TorqueDb getTorqueDb() {
          return torqueDb;
     public void setTorqueDb(TorqueDb db) {
          torqueDb = db;
     public int getCompanyId() {
          return companyId;
     public void setCompanyId(int i) {
          companyId = i;
Question:
How do I insert the code I assembled:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<logic:present name="UserContainer" property="userView" scope="session">
<span class="Company">Company
     <bean:write name="UserContainer" property="userView.companyName" scope="session"/>
!</span><br>
</logic:present>
INTO the function:
function AppSubmit() {
     str1 = "Submitting this form will begin the approval process.";
     str2 = "You will not be able to come back to this form to edit it again.";
     str3 = "Do you want to continue submitting this form?";
     if((confirm(str1 + "\n" + str2 + "\n" + str3))){
          document.forms[0].status.value="Submitted";
          document.forms[0].submit();
So that the popup window will show the [username], [CompanyName], [Date]. I can�t find any doc�s on how to insert logic into a function with str�s.
Any help would be very much appreciated. Thanks in advance.
Applications used by me: Sun solaris 8 server, Tomcat 4.1.24, pulling from postgresql 7.3, and I edit in Eclipse 2.11.

These two tags:
<logic:present name="UserContainer" property="userView" scope="session">
</logic:present>
surround things you only want to happen if there is a userView object present.
This tag:
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
is replaced with the value of userView.getFirstName().
So:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
becomes:
User Jim Steinberger !
if the userView object is present and firstName == Jim and lastName == Steinberger.
To insert those values into your JavaScript function:
<logic:present name="UserContainer" property="userView" scope="session">
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "You also agree that the following statement is true and correct to the best of your knowledge and belief:";
str4 = "";
str5 = "I, <bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>, hereby certify and state on behalf of <bean:write name="UserContainer" property="userView.companyName" scope="session"/> that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.?6314, as applicable, including authorized waivers, as they currently exist on " + new Date().getDate() + "/" + new Date().getMonth() + "/" + new Date().getFullYear() + ".";
str6 = "Do you want to continue submitting this form?";
if((confirm( str1 + "\n" + str2 + "\n" + str3 + "\n\n\n" + str4 + "\n" + str5 + "\n" + str6 ))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
</logic:present>
Should become:
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "You also agree that the following statement is true and correct to the best of your knowledge and belief:";
str4 = "I, Jim Steinberger, hereby certify and state on behalf of Dynamic Edge, Inc. that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.?6314, as applicable, including authorized waivers, as they currently exist on " + new Date().getDate() + "/" + new Date().getMonth() + "/" + new Date().getFullYear() + ".";
str6 = "Do you want to continue submitting this form?";
if((confirm( str1 + "\n" + str2 + "\n" + str3 + "\n\n" + str4 + "\n" + str5 + "\n\n" + str6 ))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
after being processed by Tomcat and Struts. (Note: the function will not appear if userView is missing)
By the way, you might be missing the closing bracket to function AppSubmit() { which might throw a JavaScript error. Just FYI :)
Good luck!
Jim Steinberger
[email protected]

Similar Messages

  • Need help with Verizon DSL & Windows XP

    Hello All,
    I am personally running Verizon FIOS without any problems. However, my father-in-law still has Verizon DSL, which he has been using without any problems for the last 4 years until now.
    To make the long story short, it seems that the LAN card that came with his old Dell PC died. I pulled it (there is no LAN NIC on the motherboard), and installed a new LAN card, which supports 10/100 MBps and is RoHS complient. However, for some unknown still to us reason, he is getting the LAN "Limited Connection" error.
    I have tried everything I could think of, and spent over 6 hours with 3 different Verizon DSL tech support folks. However, we cannot even get to 192.168.1.1 (which is the address of the Westell 6100). I have tried even slowing the LAN card to 10 Mbps / Half-Duplex (or Full). TCP/IPv4 is set to obtain IP / DNS automatically and etc...  It's also set to DHCP.
    We know fo sure that his Verizon DSL connection does work. Why? Because when I plugged in the same Ethernet cable into a laptop that I brought with me, we had an instant Internet connection (running Windows 7).
    So it must be something within Windows XP that is blocking access. I am trying to do everything to not having for him to buy a new computer at this time and save the current system.
    I have deleted any and all Network cards drivers in the Control Panel / System / Devices. I have NOT messed with any registry tricks, but am now willing.
    Any and all help with suggestions is greately appreciated.

    Best guess is that you need a WindowsXP compatible driver for your new LAN card.   You definitely need a driver, so if you "deleted any and all Network cards drivers" it isn't going to work.  Go to the company website for the new LAN card and they should have a suitable driver.
    There should not be any need to mess with the registry.

  • I need help with an Apple ID problem...

    I own a Macbook and an iPod touch, I have downloaded numerous apps for the iPod over the years. 18 months ago my boyfriend got an iPhone 3GS and created an Apple ID but it would not let him download apps due to some kind of issue registering his bank card. At the time I tried to sort it out and told him to get in touch with Apple support but he was impatient and wanted to start getting apps right away so I caved in and let him use my Apple ID. The next day I realised this was a stupid thing to do when all his apps started appearing in my iTunes. However I didn't see it as too much of a problem at the time...
    Tomorrow I am going to pick up my shiny new iPhone 5 (my first iPhone ) and I am worried about plugging it into my Mac and having all these apps that I really don't want around in my iTunes. I am imagining an absolute pain in the bum trying to sort all these apps out and syncing them to the right devices? I would absolutely love to just shift all his apps over to his Apple ID, he has loads of stuff that he needs to keep now. He does not have a computer himself, but there is no real need to plug his iPhone into my macbook ever again. After having a quick read around the forums, there seems to be no simple answer to this problem. If anyone could help with this I would be extremely grateful!

    DoubleSkin wrote:
    I would absolutely love to just shift all his apps over to his Apple ID,
    You can't. All apps are forever tied to the ID used to originally obtain them. In your case, that would be your ID. He really needs to get his own ID, delete these apps, then purchase them using his ID.
    For you, just delete what you don't want from your iTunes library.

  • I need help with a software update problem??

    I recently got a new macbook pro and I was doing a software update last night as it was required but then when it started to do the update the computer installed the software and then a barring noise came from the mac and it tried to restart 4 times before it eventually came back on. The software trying to install was Fireware 800 I think. Can anyone help with this?

    Try MacBook notebook forum to talk to other users, or OS Software (Lion or Snow Leopard)
    Does not sound like an Apple OS update though.
    http://support.apple.com/downloads/
    https://discussions.apple.com/community/notebooks
    http://www.apple.com/support/macbookpro

  • Need help with a very strange problem

    I've been using Macs since the Apple IIe and I haven't seen anything like this. I need some help "diagnosing" where the problem might lie, and what to do about it.
    I have the dock to appear and disappear automatically. But when I run the mouse down to the bottom of the screen, it doesn't appear. I have to "click" in that area to get it to appear. Also, when I select a menu in the finder or in an application, and then scroll through the menu items, they do not highlight as they should. I can click on an item to activate it, but they aren't highlighted as I scroll through.
    Also, in some applications, windows don't appear and disappear normally as they should. For example, with Adobe Lightroom I have it set up so that the adjustment panels on the left and right automatically appear and disappear. But they aren't doing that anymore.
    A restart and permissions repair will temporarily solve the problem, but it inevitably returns (sometimes within an hour, sometimes a few days). I have three users on my computer, and it happens in each user account.
    A couple days ago, I did an archive & install. That didn't fix it. Then yesterday I did a full reinstall of Leopard and then used Migration Assistant and Time Machine to migrate my users & applications to the new install. After I repaired permissions and rebooted, the problem was right there again.
    It doesn't seem like the problem is with a user account, since all three accounts have it. So why didn't a reinstall of the system fix it? And what can I do now?

    Althought the behavior is the same in all three accounts, if all are working accounts I would suspect there is something all of them have installed that could be the source of the problem. Try creating a new admin account, and leave it just the way Apple creates it--don't add anything nor modify it in any way. Log into that account and see if it works correctly.
    If that account is also misbehaving, try restarting, and when you hear the chime hold down the Shift key so that you boot into Safe Mode (you'll see a notice in the splash screen about being in Safe Mode). The boot will take longer (perhaps even considerably longer) as the system runs disk repair, empties some caches, disables all third party startup items, as well as all Apple startup items not strictly necessary for the machine to run. See the menus and Dock now behave correctly.
    Since the problem is evidently somewhat intermittent in nature it may take some patience to discover what is wrong. You might also disconnect everything that didn't come with the Mac, reboot, and use only the Apple keyboard and Apple mouse and run for a bit to see how that works. If you are using a third party mouse that required installing something that would be my guess as a "prime suspect" for the cause of the problems.
    Francine
    Francine
    Schwieder

  • Need help with notify() / wait() synchronization problem.

    I am trying to overcome a race condition that seems to be coming from the use of the swing ui file chooser in my code. I tried to solve this problem using wait/notify but I ended up in an infinite loop so and was wondering if anyone could help me out. Here are some code snipets:
    //Create a new monitor
    final private Object monitor = new Object();
    //in method getAppletdirectory()
    synchronized(monitor)
    //initialize the wizard which is a filechooser then call using the swingui showCenteredDialog
    DialogUtils.showCenteredDialog(wizard, -1, -1);
    monitor.notifyAll();
    //return some info from the wizard
    // in main method of this class
    File appletDirectory = getAppletDirectory(controller);
    synchronized(monitor) {
    try
    monitor.wait();
    catch (InterruptedException e){
    The method causes in infinite loop, I believe this is happening because the notify is being called before the dialog window has completed then when the wait is set up there is no notify to come. My problem is the wizard is used in other circumstances where it will not look for this. Would it be okay to add the notify() to the wizard's functionality even though sometimes there will be no monitor waiting for it? Can anyone give me any advice on this? Thanks.

    >
    The reason I believe this was a race condition is because when I run this code without the synchronized call and the DialogUtils.showinfoDialog commented out as shown below. When the zip occurs some of the files do not show up in the newly created .zip. But if I uncomment the dialog call then the .zip contains everything I expect it to.
    >
    Okay, so let's restate this:
    Problem
    I try to zip a file, but when I try to run the code above, then some of the files don't make it to the Zip archive. Some do, some don't.
    Diagnostics
    I notice when I call DialogUtils.showinfoDialog then the zip is formed properly. I think this is because the showinfoDialog method makes the user click on a button before returning. So my concern is that I am generating a race condition by <doing something... I have no idea what...>.
    Okay, so now we have that out of the way, You also say "Also, the reason I think this is an infinite loop is because when I added the synchronized calls and it gets to this part of the program it hangs and must be force quit." For there to be an infinite loop, there first has to be a loop, then there has to be a condition for ending the loop that never is reached. I still see no loop in your code, so it is impossible to have an infinte loop in any code that you have shown (there may be an infinite loop someplace else that you aren't showing). That said, your computer can hang for any number of other reasons, including any un-interrupted blocking operation (reading from a Stream, waiting on a BlockingQueue, calling wait() without notify()), or a deadlock situation. The problem with saying that you have an infinite loop is that the first thing to do to fix that is to look at the loop. If you don't know what is causing a hang, just say 'The program is hanging here.' That way we can look at different reasons for hangs, rather than getting caught up in a red herring of an infinite loop.
    Okay, down to the problem:
    1) Why are you including any synchronization? Why do you think you need it? How many Threads do you create? And where?
    2) We can't help you with the code you provided. It tells us nothing about what is going on. What is DialogUtils? FileUtils? RistrettoWizard? No clue. Don't know what any of those methods do. What context is this method called in? Why the synchronization?
    What you need to do is generate a short, working sample that shows the problem. Read [this site for examples.|http://sscce.org/] Make it simple, and complete. If I can't copy the code and run it to see your problem then I can't help diagnose it.

  • Need help with refreshing open window in new tab

    Hello all,
    First, all my other problems I've solved.  One last thing, being a newbie and trying things I've found on the net and them
    not working, I can use your help one last time.  My code has a Home page that peforms a Search (most of you have
    I am sure done this), and from that search submit a window opens in a new tab (browser tab) and has the results on
    it.
    That works fine.  What I'm having trouble with is being able to perform a new search and refreshing that open window
    with the new data.  Right now I am closing that window by clicking on the tab and then performing the search.
    While it works, it's not user friendly.
    So, I've tried the usual  mywindow=window.open("url.cfm"); and then trying to grab that handle to refresh, but to
    no avail.  Has anyone done this?
    Thanks!

    Here's an example of how you could do it.
    <script>
    function submitAndFocusTarget(form) {
      var win = window.open("", form.target);
      form.submit();
      win.focus();
    </script>
    <form action="index.cfm" target="mysearchwin" method="get" onsubmit="submitAndFocusTarget(this); return false;">
      <input type="text" name="search" value="" />
      <input type="submit" value="search" />
    </form>

  • Need HELP with objects and classes problem (program compiles)

    Alright guys, it is a homework problem but I have definitely put in the work. I believe I have everything right except for the toString method in my Line class. The program compiles and runs but I am not getting the right outcome and I am missing parts. I will post my problems after the code. I will post the assignment (sorry, its long) also. If anyone could help I would appreciate it. It is due on Monday so I am strapped for time.
    Assignment:
    -There are two ways to uniquely determine a line represented by the equation y=ax+b, where a is the slope and b is the yIntercept.
    a)two diffrent points
    b)a point and a slope
    !!!write a program that consists of three classes:
    1)Point class: all data MUST be private
    a)MUST contain the following methods:
    a1)public Point(double x, double y)
    a2)public double x ()
    a3public double y ()
    a4)public String toString () : that returns the point in the format "(x,y)"
    2)Line class: all data MUST be private
    b)MUST contain the following methods:
    b1)public Line (Point point1, Point point2)
    b2)public Line (Point point1, double slope)
    b3)public String toString() : that returns the a text description for the line is y=ax+b format
    3)Point2Line class
    c1)reads the coordinates of a point and a slope and displays the line equation
    c2)reads the coordinates of another point (if the same points, prompt the user to change points) and displays the line equation
    ***I will worry about the user input later, right now I am using set coordinates
    What is expected when the program is ran: example
    please input x coordinate of the 1st point: 5
    please input y coordinate of the 1st point: -4
    please input slope: -2
    the equation of the 1st line is: y = -2.0x+6.0
    please input x coordinate of the 2nd point: 5
    please input y coordinate of the 2nd point: -4
    it needs to be a diffrent point from (5.0,-4.0)
    please input x coordinate of the 2nd point: -1
    please input y coordinate of the 2nd point: 2
    the equation of the 2nd line is: y = -1.0x +1.0
    CODE::
    public class Point{
         private double x = 0;
         private double y = 0;
         public Point(){
         public Point(double x, double y){
              this.x = x;
              this.y = y;
         public double getX(){
              return x;
         public double setX(){
              return this.x;
         public double getY(){
              return y;
         public double setY(){
              return this.y;
         public String toString(){
              return "The point is " + this.x + ", " + this.y;
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }My problems:
    I dont have the right outcome due to I don't know how to set up the toString in the Line class.
    I don't know where to put if statements for if the points are the same and you need to prompt the user to put in a different 2nd point
    I don't know where to put in if statements for the special cases such as if the line the user puts in is a horizontal or vertical line (such as x=4.7 or y=3.4)
    Edited by: ta.barber on Apr 20, 2008 9:44 AM
    Edited by: ta.barber on Apr 20, 2008 9:46 AM
    Edited by: ta.barber on Apr 20, 2008 10:04 AM

    Sorry guys, I was just trying to be thorough with the assignment. Its not that if the number is valid, its that you cannot put in the same coordinated twice.
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }The problem is in these lines of code.
    public double slope(Point point1, Point point2) //if this method finds the slope than how would i use the the two coordinates plus "m1" to
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
         }if slope method finds the slope than how would i use the the two coordinates + "m1" to create a the line in toString?

  • Need Help with safari for Windows 8

    i am stuck with the need to have a pc due to a proprietary business software... I am a mac user and prefer to use safari... i just had to by a new pc and tried to download safari for windows 8.1 but cannot find it... any help out there?

    Apple hasn't supported Safari for Windows in quite a while (and even when they did, you wouldn't want it - total crap). IE 11 actually isn't bad, you can also try Chrome.

  • Need help with pop up window!

    I'm working on an online graphic design portfolio and one of the pages features online animated Flash banners.  The site can be viewed here...
    http://truetilldeathhq.com/Skiz/main8_v7.html
    I created a pop up window that displays a swf of the banner by putting this code on the View Banner link of each example of work...
    on (release) {
    var jscommand:String = "window.open('http://www.truetilldeathhq.com/Skiz/banners/336x280DuvalCX9.html','win','height= 296,width=352,left=112,top=330,toolbar=no,resizable=no,location=no,scrollbars=no ');";getURL("javascript:" + jscommand + " void(0);");
    Two problems though.  First is in Firefox the location bar with the url to the swf is visible, even though I set location=no as a variable in the code (it works ok in Safari).  The window is also resizable in Firefox and Safari even though the variable is set to resizable=no.  How can I fix this?
    Second problem, even though I painstakingly set the left and top variables by trial and error to get the pop up window to open exactly in the center of the "stage" area of the site, when I post it and view it in a browser, the window pops up lower.  When I'm in the fla of the site and I preview it in a browser, it's fine, but for some reason when I post the files online and then open it from http://truetilldeathhq.com/Skiz/main8_v7.html, the pop ups come in lower.  Any fixes or advice on this?
    Thanks for your help!

    Forgive me for my ignorance, but I'm new to Flash and any kind of scripting and I didn't quite follow that page you directed me to.  Right now I'm working up a Flash template and the action on the link for the banner pages looks like this:
    on(rollOver) {
    this.gotoAndPlay("s1");
    on(rollOut, releaseOutside) {
    this.gotoAndPlay("s2");
    on (release) {
    _root.popup_pressed=1;
    _root.scrHEIGHT=240
    _root.scroller.scroller.gotoAndStop(2);
    _root.TM_title = "Work 1 read more";
    _root.READ = 1;
    _root.scroller.gotoAndPlay("s1");
    How can I work up the on (release) so I'll get a simple pop up window, say 728x90, no scrollbars or resizing, that will open somewhere in the middle of the site?  If I wanted a title to the pop up window, how would I do that?
    Again, thanks so much for your time and excuse my newbieness.

  • Need help with jre-1_5_0_04 windows i586 use windows 98 first edition HELP

    HI,
    this is my first post here so please bear with me while I try to explain the problems I seem to be having here . I hope that someone here can assist me with these issues as well???
    I am using the windows98 first edition, and I wanted to use the latest version of java which I think is this 1_5_0_04 version, but when I get it download it said it is recommended that I not use this version,
    but I work with Yahoo sitebuilder for my online websites and need this verision to get sitebuilder to work?
    Now I read somewhere just dont remember where forgive me, but it said in that artical that there is a workaround or something to that nature to make this version of Java to work with the windows 98 version I am using?
    I do seem to have other versions of java on this PC as well but dont no how to remove them all and where to look to remove the older versions of java if need be to get this latest version of java to work right for me?
    I did the test and it said I have the latest version of the java but like I said it now wont seem to work with this yahoo site builder and it was working before but just mega and I do mean mega sloww???
    can someone please further assist me with this and please, I will need detail step by step as to how to get this java to work with my PC and be workable with the Yahoo sitebuilder as well???
    thanks in advance and I eagerly await some useful steps to try out here .
    I think also that I might need to go in and change paths or classes or something of that nature as well to try to get it to work. the java??
    Now the download took I wanted to mention apart from the install part that said this might not be compatiable with the version of windows that I am useing but I am hopeing again that there is a work around to this issue??
    thanks
    LIBBY

    There is no work around, that Windows version is no longer compatible.
    You can find older versions of Java here:
    http://java.sun.com/products/archive/index.html
    You may want to find the latest version that is compatible with your Windows, and install that.
    I strongly recommend that you uninstall all existing Java versions first. Do that using Windows' Add/Remove Program function.

  • Need help with a SpryImageSlideShow load problem

    I am using Dreamweaver CS5.
    I have a spryImageSlideshow on my site. I can't get the slideshow to load if there are only 2 images or less in the slideshow. It only automatically loads the large image when there are 3 photos or more in the slideshow. How do I fix this to start with only 1-2 photos in the slideshow?

    Hi
    We usually need to see ALL your code to solve your issue quickly and accurately without a lot of guessing and questions back-and-forth.
    Just rename a copy of your problem page  (such as "test.html")  and upload it to your server, in whatever folder the original page was located, and simply post a link in the Forum and tell us your problem.
    This saves you having to cut and paste miles of code into the Forum for the page and all the dependent CSS, JS etc. files.and saves us from having to recreate all your filles, find your images and then repair your code and test the solution for you.
    I trust this is helpful.

  • Need HELP with crazy rendering /  saving problem

    I am finishing up a project that I need to deliver on DVD in the next couple of days.
    Suddenly, something strange is happening.
    There are several audio clips that have some filters applied to them. When I play them in the timeline, they sound fine, until I render them.
    Then, the audio in those clips gets muddy and way quiet.
    When I click off the filter, the volume comes back.
    Then, if I click on the filter again, the filtered settings are applied and it sounds fine.
    However, as soon as I render, it all goes wacky again.
    This is making me nervous, as the deadline is looming.
    THanks for any help.

    What are your timeline settings for audio? What are the filters for? If you export a small section as a test, does the audio sound bad when you play back the quicktime?
    I just remembered - when I experienced this before, it was the result of audio that was inverted in one channel, so as long as they came out of separate speakers, there was no problem, but when they were mixed, they canceled each other out resulting in severely decreased volume.
    As my problem was just with Voice Over, I simply deleted one of the audio channels, then doubled the remaining one and panned it properly.
    Dunno if that's your issue, but you might investigate that...
    Patrick

  • Help with a popup window displaying info from a record set

    Hi I am working on a Shopping cart web site I have set up my
    database and I have created my page to display items from the
    database. The fields in my database table are auto_id, category,
    sub_catagory, manufacture, style, descripition, descripition2,
    price, image, image2, fc_id, link_id
    What I am trying to do is to display this part of the info in
    one record . manufacture,style,descripition , image and price there
    will be a link from this page (link_id)to display a popup and in
    that pop up I want to display
    manufacture,style,descripition2,Image2
    basicly I want to now how to put a link in database so when
    all of the data is displayed on the page I want to click on a link
    (link_id) from any record that opens a popup to display a larger
    image and a longer descripition of the product. and anything else I
    may need from that record.
    I hope this maks sence
    Cheers
    Dave

    In your product insert form or however you are adding these
    products to the store add a feild called image link2 or
    large_img_link
    in your code for the pop up window you would wrap your PHP
    recordset like this
    <a href="
    http://yoursite.com/images/large_images/<?php
    echo $row_image_rs['large_img_link']; ?>"><?php echo
    $row_image_rs['large_img_link']; ?></a>
    This will produce a link like this
    http://yoursite.com/images/large_images/myLargeImage.jpg
    the hot spot will be your second php tag which is the
    thumbnail image itself that is now wrapped with the larger image
    link.
    Hope this is helpfull
    JM

  • Need help with long term Java problems

    I've been having problems with Java on my computer for about a year now, and I'm hoping that someone here can help me out.
    Java used to work fine on the computer when I first got it (a Dell laptop) and I hadn't installed anything myself. But then one day it stopped loading Java applets, and hasn't worked since. By this, I mean that I get the little colorful symbol in a box when I try to play Yahoo games, use the http://www.jigzone.com site, go to chat rooms, etc. Java menus on websites like http://www.hartattack.tv used to work still, but lately they've been giving me that symbol too.
    I've tried downloading a newer version of Java, but nothing I do seems to work, and I don't know of anything I did to trigger it not working. I'm hoping there's a simple solution to this, and I'm just dumb.
    Thanks.

    This might be way off, but it's something that's tripped me up in the past:
    If you are using Sun's Java plugin, the first time you go to a site that has a particular Java applet, you may be asked to approve/reject a security request.
    If you have clicked on any other windows while the request is first being loaded (which can take some time, because this is swing based), then the security dialog box does not pop to the top of the window stack, and doesn't add an entry into the task bar.
    It appears that Java just doesn't work, but it's actually waiting for you to click "Yes". You can check this by hitting alt-tab and seeing if the Java coffee cup icon is one of the options.
    - K

Maybe you are looking for

  • SQL Developer 1.1 and Java problems.

    I downloaded and tried to run the sqldeveloper.exe. I am getting a prompt with a browse option to java.exe. I currently have JRE 1.6 installed and somehow SQL Developer didn't like it. So I went and installed JRE 1.5 and it's still complaining that i

  • Call a class after successfuly starting weblogic server

    I need to create a class which which some parameter and start a application automatically just after starting weblogic server so that when user request for application he will get quick response. Actually my application takes some time to be start se

  • HTML Help in a JAVA Application?

    Hope someone can answer this question. I thought that there was a way to use HTML Help with a JAVA application, but I am being advised by my programmer that I must use JAVA Help. I don't have a problem with using RoboHelp to convert my HTML Help file

  • New User - Need Help - Video Trailers

    I made a 15 min DVD usind IDVD, it looks good on the IMAC but when I play it on an external DVD player, the motion has trailers (esp when there is a lot going on). Anyone have an idea of how to fix this? IMAC   Mac OS X (10.4.7)  

  • Recharging iphone in Europe

    Hi everybody! I've been reading nearly all the posts for iphone use while overseas and I deeply thank everybody! I learned so much! One extra question. I am going to Italy and I was wondering if I should buy a converter for the different voltage? Or