Help with adding math to my read in file program
Hi, my code displays the txt data fine but where the second read in part i need to do some adding and division with each number. It gives me an error when I try it, how could i fix this?
gravity.txt
|
0.37 0.89 1.00 0.37 2.48 1.05 0.89 1.11 0.07
* Write a description of class WeightOnPlanetsV1 here.
* @author (your name)
* @version (a version number or a date)
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.File;
import java.io.IOException;
public class WeightOnPlanetsV1
public static void main(String[] args) throws IOException
int planetWidth = 10;
int gravityWidth = 16;
int weightWidth = 14;
String formatString = "%" + planetWidth + "s%" + gravityWidth + "s%"
+ weightWidth + "s%n";
System.out.printf("%40s\n\n", "My Wight on the Planets");
System.out.printf(formatString, "Planet", "Gravity", "Weight");
System.out.printf("---------------------------------------------------%n");
String[] planets =
"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus",
"Neptune", "Pluto"
String token = "";
File fileName = new File("gravity.txt");
Scanner inFile = new Scanner(fileName);
List space = new ArrayList();
while (inFile.hasNext())
token = inFile.next();
space.add(token);
inFile.close();
String token1 = 0; // or double
File fileName1 = new File("gravity.txt");
Scanner inFile1 = new Scanner(fileName1);
List space1 = new ArrayList();
while (inFile1.hasNext())
token1 = inFile1.next();
space1.add(token1);
inFile1.close();
for (int i = 0; i < planets.length; i++)
System.out.printf(formatString, planets, space.get(i), space1.get(i));
opps okay it works but i just don't know how to do the math part?
* Write a description of class WeightOnPlanetsV1 here.
* @author (your name)
* @version (a version number or a date)
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.File;
import java.io.IOException;
public class WeightOnPlanetsV1
public static void main(String[] args) throws IOException
int planetWidth = 10;
int gravityWidth = 16;
int weightWidth = 14;
String formatString = "%" + planetWidth + "s%" + gravityWidth + "s%"
+ weightWidth + "s%n";
System.out.printf("%40s\n\n", "My Wight on the Planets");
System.out.printf(formatString, "Planet", "Gravity", "Weight");
System.out.printf("---------------------------------------------------%n");
String[] planets =
"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus",
"Neptune", "Pluto"
String token = "";
File fileName = new File("gravity.txt");
Scanner inFile = new Scanner(fileName);
List space = new ArrayList();
while (inFile.hasNext())
token = inFile.next();
space.add(token);
inFile.close();
String token1;
File fileName1 = new File("gravity.txt");
Scanner inFile1 = new Scanner(fileName1);
List space1 = new ArrayList();
while (inFile1.hasNext())
token1 = inFile1.next();
space1.add(token1);
inFile1.close();
for (int i = 0; i < planets.length; i++)
System.out.printf(formatString, planets, space.get(i), space1.get(i));
Similar Messages
-
Help with adding filename to my 400 pdf files
Hi everyone,
Now i have 400 pdf files in my hands and i want to print them all with the filename of each files on the page. Is there anyway i can do it in one go?]
thanks,Creating a Batch Sequence using Acrobat Pro -
--| Select, from the menu bar, Advanced > Document Processing > Batch Processing
The Batch Sequence dialog presents itself.
--| Click the 'New Sequence' button.
The Name Sequence dialog presents itself.
--| Enter a name for the new sequence (e.g., "Add Watermark").
The Edit Batch Sequence - Add Watermark dialog presents itself.
--| Click the 'Select Commands' button.
The Edit Batch Sequence dialog presents itself.
The left side column lists commands; under the 'Document' folder -
--| Select 'Add Watermark' and then click the 'Add >>' button.
--| Click the 'Edit' button.
The Add Watermark dialog presents itself.
Configure as desired. Note the links "Page Range Options" (upper right) and "Appearance Options" (left side, just below center).
You may want to use these options as part of the Watermark's configuration.
When configuration within the Add Watermark dialog is complete, click OK.
OK out of the Edit Sequence dialog.
Back in the Edit Batch Sequence - Add Watermark dialog continue with configuration options as desired.
Note: There is a square adjacent to the "Add Watermark" command that was selected.
For unattended operation, leave this box NOT ticked.
Clicking the 'Output Options' button provides access to a dialog from which you can choose to utilize PDF Optimizer.
The 'Settings' button provides access to PDF Optimizer's configuration dialog.
With all desired configuration complete, OK out of the Edit Batch Sequence - Add Watermark dialog.
Click the 'Run Sequence' button to run a selected Batch Sequence.
The configuration selection made for "2. Run commands on:" (in the Edit Batch Sequence - <name of sequence>) determines what you will observe next.
It may be that Acrobat JavaScript will be needed to pull each PDF's document file name (?).
So - Some other information associated with PDF document's file name -
(thomp) posts at AUC:
http://acrobatusers.com/forums/aucbb/viewtopic.php?id=7428
http://acrobatusers.com/forums/aucbb/viewtopic.php?id=2908
(try67) posts at AUC:
http://acrobatusers.com/forums/aucbb/viewtopic.php?id=20725
"Print File Name with pdf Document" thread from this Forum (an older thread, but informative).
http://forums.adobe.com/thread/302996
Be well... -
Help with adding image onclick
Hey everyone,
I am making a simple game in AS3 and need help with adding an image once they have click on something.
On the left of the screen are sentences and on the right an image of a form. When they click each sentence on the left, writing appears on the form. Its very simple. With this said, what I would like to do is once the user click one of the sentences on the left, I would like a checkmark image to appear over the sentence so they know they have already clicked on it.
How would I go about adding this to my code?
var fields:Array = new Array();
one_btn.addEventListener(MouseEvent.CLICK, onClick1a);
one_btn.buttonMode = true;
function onClick1a(event:MouseEvent):void
fields.push(new one_form());
fields[fields.length-1].x = 141;
fields[fields.length-1].y = -85;
this.addChild(fields[fields.length-1]);
one_btn.removeEventListener(MouseEvent.CLICK, onClick1a);
one_btn.buttonMode = false;
//gotoAndStop("one")
two_btn.addEventListener(MouseEvent.CLICK, onClick2a);
two_btn.buttonMode = true;
function onClick2a(event:MouseEvent):void
fields.push(new two_form());
fields[fields.length-1].x = 343.25;
fields[fields.length-1].y = -85;
this.addChild(fields[fields.length-1]);
two_btn.removeEventListener(MouseEvent.CLICK, onClick2a);
two_btn.buttonMode = false;
//gotoAndStop("two")I don't know where you're positioning the button that should enable/disable the checkbox but for "one_btn" let's just say it's at position: x=100, y=200. Say you'd want the checkbox to be to the left of it, so the checkbox would be displayed at: x=50, y=200. Also say you have a checkbox graphic in your library, exported for actionscript with the name "CheckBoxGraphic".
Using your code with some sprinkles:
// I'd turn this into a sprite but we'll use the default, MovieClip
var _checkBox:MovieClip = new CheckBoxGraphic();
// add to display list but hide
_checkBox.visible = false;
// just for optimization
_checkBox.mouseEnabled = false;
_checkBox.cacheAsBitmap = true;
// adding it early so make sure the forms loaded don't overlap the
// checkbox or it will cover it, otherwise swapping of depths is needed
addChild(_checkBox);
// I'll use a flag (a reference for this) to know what button is currently pushed
var _currentButton:Object;
one_btn.addEventListener(MouseEvent.CLICK, onClick1a);
one_btn.buttonMode = true;
function onClick1a(event:MouseEvent):void
// Check if this button is currently the pressed button
if (_currentButton == one_btn)
// disable checkbox, remove form
_checkBox.visible = false;
// form should be last added to fields array, remove
removeChild(fields[fields.length - 1]);
fields.pop();
// clear any reference to this button
_currentButton = null;
else
// enable checkbox
_checkBox.visible = true;
_checkBox.x = 50;
_checkBox.y = 200;
// add form
fields.push(new one_form());
fields[fields.length-1].x = 141;
fields[fields.length-1].y = -85;
this.addChild(fields[fields.length-1]);
// save this button as last clicked
_currentButton = one_btn;
// not sure what this is
//gotoAndStop("one")
I'd also centralize all the click handlers into a single handler and use the buttons name to branch on what to do, but that's a different discussion. Just see if this makes sense to you.
The jist is a graphic of a checkbox that is a MovieClip symbol in your library exported to actionscript with the class name CheckBoxGraphic() is created and added to the display list.
I made a variable that points itself to the last clicked button, when the "on" state is desired. If I detect the last clicked button was this button, I remove the form I added and the checkbox. If the last clicked button is not this button, I enable and position the checkbox as well as add the form.
What is left to do is handle the sitation where multiple buttons are on the screen. When a new button is pushed it should remove anything the previous button added. This code simply demonstrates clicking the same button multiple times to toggle it "on and off". -
i am trying to get help with WMPlayer tech support Adobe Reader cant open wmpsupport.htm files why?
Adobe Reader opens PDF files, nothing else.
-
Help with adding a hyperlink to a button?
We have a simple little site we built in Catalyst and everything works great. The only problem is that we cannot figure out how to add a hyperlink to one of the buttons in the animation. We simply want to be able to click on the button and go to another site (the client's Facebook page specifically). Can anyone provide some insight? Thanks!
The message you sent requires that you verify that you
are a real live human being and not a spam source.
To complete this verification, simply reply to this message and leave
the subject line intact.
The headers of the message sent from your address are shown below:
From [email protected] Tue Nov 03 19:08:07 2009
Received: from mail.sgaur.hosted.jivesoftware.com (209.46.39.252:45105)
by host.pdgcreative.com with esmtp (Exim 4.69)
(envelope-from <[email protected]>)
id 1N5TPy-0001Sp-J1
for [email protected]; Tue, 03 Nov 2009 19:08:07 -0500
Received: from sgaurwa43p (unknown 10.137.24.44)
by mail.sgaur.hosted.jivesoftware.com (Postfix) with ESMTP id 946C5E3018D
for <[email protected]>; Tue, 3 Nov 2009 17:08:03 -0700 (MST)
Date: Tue, 03 Nov 2009 17:07:49 -0700
From: Tvoliter <[email protected]>
Reply-To: [email protected]
To: Matthew Pendergraff <[email protected]>
Message-ID: <299830586.358941257293283616.JavaMail.jive@sgaurwa43p>
Subject: Help with adding a hyperlink to a button?
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_36702_1132901390.1257293269030"
Content-Disposition: inline
X-Spam-Status: No, score=-3.4
X-Spam-Score: -33
X-Spam-Bar: ---
X-Spam-Flag: NO -
Need help with adding emoji to my hubby's phone don't see it when I click on the keyboard tab
I need help with adding emoji to my hubby's iPhone when I go to settings then the keyboard tab it's not there
I did that bad it's not there and doesn't give me to option to click on it
-
I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?
By doing a Google search.
-
[CS3 JS] Help with adding textMacros
I can get a textMacro added with the following.
app.textMacros.add("myName", "this is some text")
What I am having trouble with is having the Remember Text Attributes be grabed or set to true.
Any one know what the syntax is for setting this during the add()
also how do you insert a macro via a javascript?
Mahalo
DavidThese forums are pointless. Adobe must believe that other users will cut the mustard. Absolutely a waste of effort for everyone. Adobe should PAY at least a junior developer involved in the projects to monitor and help with these posts. FLEX rules yeah and thousands more do scripting than develop plug ins...
Come on Adobe, step up your better than this. Customer Service can be free to the customers ... we are not talking about GET IT ALL FREE, talking about buy it and create a community and support it, but then again LAYERS and INDESIGN SECRETS have people who actually want to help users rather than rabbit hole everything.
Please join hands and SING... -
Need help with adding buttons.
I thought I could do this without help but I was wrong. I had to add buttons to my program and before it ran fine with the first four buttons I added but know there are many errors and I believe I messed up the whole thing now. Any advice would be greatly appreciated. Here is my code:
import java.util.*;
import java.text.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.JFrame.*;
import java.io.*;
import java.awt.font.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.awt.image.*;
public class DVDInventory6
public static void main(String[] args)
Scanner input = new Scanner( System.in );
int j;
DVD_Genre [] inventory = new DVD_Genre[5]; // Size of the array
// create DVD object
inventory [ 0 ] = new DVD_Genre( "Rocky", "Action/Drama", 01, 15, 9.95 );
inventory [ 1 ] = new DVD_Genre( "RockyII", "Action/Drama", 02, 13, 14.95 );
inventory [ 2 ] = new DVD_Genre( "Matrix", "Action/Sci-Fi", 03, 23, 14.95 );
inventory [ 3 ] = new DVD_Genre( "MatrixII", "Action/Sci-Fi", 04, 17, 19.95 );
inventory [ 4 ] = new DVD_Genre( "Bambi", "Family", 05, 33, 12.95 );
// Print out a screen title
System.out.println();
System.out.printf("Welcome to DVD Inventory:\n\n");
GUI gui = new GUI();
for(j=0; j<5; ++j)
gui.add(inventory[j]);
double total = 0;
for ( j=0; j<inventory.length; j++ )
total += inventory[j].getvalueofdvds ();
} // end for
gui.setTotal(total);
gui.display();
public static void sortDVD(DVD[] inventory)
//DVD_Genre temp[] = new DVD_Genre[1];
int i, j;
for (i=1; i <inventory.length; i++)
for (j=0; j < inventory.length-i; j++)
if (inventory[j].getdvdName().compareTo(inventory[j+1].getdvdName())>0)
// exchange elements
DVD temp = inventory[j]; //new DVD_Genre [1];
inventory[j] = inventory[j+1];
inventory[j+1] = temp; //temp [0];
}//end method main
}//end DVDInventory6
class DVD
protected String dvdName; // DVD title
protected String dvdGenre; // DVD genre
protected int productnumber; // DVD product number
protected int numberofproducts; // the number of products in stock
protected double price; // the price of the products in stock
public DVD (String name, String genre, int productnumber, int numberofproducts,
double price ) // class dvd constructor
this.dvdName = name;
this.productnumber = productnumber;
this.numberofproducts = numberofproducts;
this.price = price;
this.dvdGenre = genre;
public DVD( String name, int productnumber, int numberofproducts, double price ) //
class dvd constructor
this.dvdName = name;
this.productnumber = productnumber;
this.numberofproducts = numberofproducts;
this.price = price;
public void setdvdName( String name ) // method to set dvd name
this.dvdName = name; // store the dvd name
public String getdvdName()// method to get dvd name
return dvdName;
public void setproductnumber( int productnumber ) // method to set productnumber
this.productnumber = productnumber; // store productnumber
public int getproductnumber()// method to get productnumber
return productnumber;
public void setnumberofproducts( int numberofproducts )// method to set
numberofproducts
this.numberofproducts = numberofproducts; // store numberofproducts
public int getnumberofproducts()// method to get numberofproducts
return numberofproducts;
public void setprice( double price )// method to set price
this.price = price; // price of the products in stock
public double getprice()// method to get price
return price;
public double getvalueofdvds()// method to get valueofdvds
return numberofproducts * price;
} // end class DVD
class DVD_Genre extends DVD
private String genre; // genre of DVD
private double restockingFee; // percentage added to inventory value
//constructor
public DVD_Genre(String name, String genre, int productnumber, int numberofproducts, double
price)
super(name, genre, productnumber, numberofproducts, price);
this.genre = genre;
this.restockingFee = restockingFee;
public void setdvdGenre( String genre ) // method to set dvd genre
this.dvdGenre = genre; // store the dvd genre
public String getdvdGenre()// method to get dvd genre
return dvdGenre;
// Calculates restocking fee based on previous data.
public double restockFee() {
double total = 0;
double restock = 0;
total = numberofproducts * price;
restock = total * .05;
return restock;
public String toString()
DecimalFormat Currency = new DecimalFormat("$0.00");
return "\nDVD Title: " + dvdName + "\nDVD Genre: " + dvdGenre + "\nProduct number: " +
productnumber +
"\nNumber of products: " + numberofproducts + "\nPrice: " + price + "\nValue of
DVD's: " + Currency.format(numberofproducts * price) + "\nRestock Fee: " +
Currency.format(numberofproducts * price * .05);
}// End class DVD_Genre
class GUI {
private DVD[] dvds;
private int nCount;
private double total;
// Creates array DVD[]
GUI() {
dvds = new DVD[5];
nCount = 0;
public void add(DVD dvd) {
dvds[nCount] = dvd;
++nCount;
public void setTotal(double total)
this.total = total;
DecimalFormat Currency = new DecimalFormat("$0.00");
//Displays the arrays contents element by element into a GUI pane
public void display() {
GUIDisplay(dvds, 5);
public void GUIDisplay(DVD[] products, int numOfProducts)
PanelFrame frame = new PanelFrame(products, numOfProducts);
frame.pack();
frame.setVisible(true);
frame.setSize(600, 450);
} // end class GUI
class PanelFrame extends JFrame
private JButton first;
private JButton next;
private JButton previous;
private JButton last;
private JButton add;
private JButton delete;
private JButton modify;
private JButton search;
private JButton save;
JTextField dvdName;
JTextField productnumber;
JTextField numberofproducts;
JTextField price;
private DVD[] products;
private int numOfProducts;
private int currentIndex = 0;
/** Creates a new instance of PanelFrame */
public PanelFrame(DVD[] products, int numOfProducts)
super("Welcome to the DVD Inventory");
this.products = products;
this.numOfProducts = numOfProducts;
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
setLayout(new GridLayout(6,1,5,5));
showLogo();
showLabels();
showInputFields();
showButtons();
public class MovieGraphics extends Component
private BufferedImage image;
private boolean imageFound = true;
public MovieGraphics()
super();
try
image = ImageIO.read(new File("logo.jpg"));
catch (IOException x)
x.printStackTrace();
imageFound = false;
public void paint(Graphics g)
if (imageFound)
g.drawImage(image,
0, 0, 200, 100,
0, 0, image.getWidth(null), image.getHeight(null),
null);
else
g.drawString("Gary's DVD Krypt", 30, 30);
} // end of class MovieGraphics
public void showLogo()
MovieGraphics myLogo = new MovieGraphics();
this.add(myLogo);
public void showLabels()
JPanel panel = new JPanel();
panel.add(new JLabel("DVD Title"));
panel.add(new JLabel("Product number"));
panel.add(new JLabel("Number of products"));
panel.add(new JLabel("Price"));
this.add(panel);
public void showInputFields()
JPanel panel = new JPanel();
dvdName = new JTextField(10);
productnumber = new JTextField(10);
numberofproducts = new JTextField(10);
price = new JTextField(10);
dvdName.setEditable(false);
productnumber .setEditable(false);
numberofproducts.setEditable(false);
price.setEditable(false);
panel.add(dvdName);
panel.add(productnumber );
panel.add(numberofproducts);
panel.add(price);
this.add(panel);
public void showButtons()
JPanel panel = new JPanel();
first = new JButton("First");
next = new JButton("Next");
previous = new JButton("Previous");
last = new JButton("Last");
add = new JButton("Add");
delete = new JButton("Delete");
modify = new JButton("Modify");
search = new JButton("Search");
save = new JButton("Save");
panel.add(first);
panel.add(next);
panel.add(previous);
panel.add(last);
panel.add(add);
panel.add(delete);
panel.add(modify);
panel.add(search);
panel.add(save);
ButtonActionHandler handler = new ButtonActionHandler();
first.addActionListener(handler);
next.addActionListener(handler);
previous.addActionListener(handler);
last.addActionListener(handler);
add.addActionListener(handler);
delete.addActionListener(handler);
modify.addActionListener(handler);
search.addActionListener(handler);
save.addActionListener(handler);
this.add(panel);
setFields(0);
protected void paintComponent(Graphics g)
public void setFields(int i)
setdvdName(i);
setproductnumber(i);
setnumberofproducts(i);
setPrice(i);
public void setdvdName(int i)
dvdName.setText(products.getdvdName());
public void setproductnumber(int i)
productnumber.setText(String.valueOf(products[i].getproductnumber()));
public void setnumberofproducts(int i)
numberofproducts.setText(String.valueOf(products[i].getnumberofproducts()));
public void setPrice(int i)
price.setText(String.valueOf(products[i].getprice()));
private class ButtonActionHandler implements ActionListener
public void actionPerformed(ActionEvent event)
if (event.getSource() == first)
addClicked = false;
currentIndex = 0;
setFields(currentIndex);
makeFieldsEditable(false);
else if (event.getSource() == next)
addClicked = false;
currentIndex++;
if (currentIndex == numOfProducts)
currentIndex --;
setFields(currentIndex);
makeFieldsEditable(false);
else if (event.getSource() == previous)
addClicked = false;
currentIndex--;
if (currentIndex < 0)
currentIndex = 0;
setFields(currentIndex);
makeFieldsEditable(false);
else if (event.getSource() == last)
addClicked = false;
currentIndex = numOfProducts - 1;
if (currentIndex < 0)
currentIndex = 0;
setFields(currentIndex);
makeFieldsEditable(false);
else if(event.getSource() ==add)
//add actions for add here
if (!addClicked)
resetFields();
makeFieldsEditable(true);
int itemNum = incrementItemNumber();
System.out.println(itemNum);
itemNumber.setText(String.valueOf(itemNum));
currentIndex = numOfProducts;
addClicked = true;
else if(event.getSource() ==save)
//add actions for save here
//we need to call SaveToFile.java
// SaveToFile.save;
addClicked = false;
System.out.println(currentIndex);
if (!updateProduct(currentIndex))
JOptionPane.showMessageDialog(null, "You have reached maximum number of products!");
currentIndex --;
setFields(currentIndex);
else
saveProduct();
makeFieldsEditable(false);
else if(event.getSource() == edit)
//add actions for edit here
// Inventory.edit;
addClicked = false;
makeFieldsEditable(true);
else if(event.getSource() == search)
//add actions for search here
// Inventory.findIndex;
addClicked = false;
String name = JOptionPane.showInputDialog("Enter Product Name: ");
int index = searchName(name);
System.out.println(index);
if (index == -1)
JOptionPane.showMessageDialog(null, "No matching product found! ");
else
currentIndex = index;
setFields(index);
Here are my errors:
C:\java>javac DVDInventory6.java
DVDInventory6.java:460: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:463: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(false);
^
DVDInventory6.java:467: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:474: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(false);
^
DVDInventory6.java:478: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:485: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(false);
^
DVDInventory6.java:489: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:496: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(false);
^
DVDInventory6.java:501: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
if (!addClicked)
^
DVDInventory6.java:503: cannot find symbol
symbol : method resetFields()
location: class PanelFrame.ButtonActionHandler
resetFields();
^
DVDInventory6.java:504: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(true);
^
DVDInventory6.java:505: cannot find symbol
symbol : method incrementItemNumber()
location: class PanelFrame.ButtonActionHandler
int itemNum = incrementItemNumber();
^
DVDInventory6.java:507: cannot find symbol
symbol : variable itemNumber
location: class PanelFrame.ButtonActionHandler
itemNumber.setText(String.valueOf(itemNum));
^
DVDInventory6.java:510: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = true;
^
DVDInventory6.java:517: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:519: cannot find symbol
symbol : method updateProduct(int)
location: class PanelFrame.ButtonActionHandler
if (!updateProduct(currentIndex))
^
DVDInventory6.java:527: cannot find symbol
symbol : method saveProduct()
location: class PanelFrame.ButtonActionHandler
saveProduct();
^
DVDInventory6.java:529: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(false);
^
DVDInventory6.java:531: cannot find symbol
symbol : variable edit
location: class PanelFrame.ButtonActionHandler
else if(event.getSource() == edit)
^
DVDInventory6.java:535: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:536: cannot find symbol
symbol : method makeFieldsEditable(boolean)
location: class PanelFrame.ButtonActionHandler
makeFieldsEditable(true);
^
DVDInventory6.java:542: cannot find symbol
symbol : variable addClicked
location: class PanelFrame.ButtonActionHandler
addClicked = false;
^
DVDInventory6.java:544: cannot find symbol
symbol : method searchName(java.lang.String)
location: class PanelFrame.ButtonActionHandler
int index = searchName(name);
^
23 errorsand many more errors
such as;
* you need to declare a method called makeFieldsEditable that takes a boolean value
eg private void makeFieldsEditable(boolean editable){
// add your implememntation
}* you need to declare a method called resetFields
eg private void resetFields(){
// add your implememntation
}* you need to declare a method called updateProduct
eg private void updateProduct(int index){
// add your implememntation
}etc -
Help With Adding Back Up of Songs & Lists on Re-Installed iTunes v 7.0.2
I have a portable hard drive with a back up of my 10,000 songs. I have to get my Gateway PC laptop serviced as it continues to crash, and so I will need to re-install iTunes v 7.0.2 and then add back my songs from the portable hard drive.
I need help with a couple of questions:
1) Is there a quicker way to add the songs back on to iTunes rather than adding individual files (for songs) and individual folders (for albums)?
2) I have several song lists (some used to make CD's). How can these lists be backed up as well so that I do not have to re-create these lists?
Any advice very much appreciated.There is a good article on backup here:
http://discussions.apple.com/thread.jspa?messageID=1522195�
If all your music is in the iTunes Music folder and you have room, just copy the iTunes folder to your external drive.
This will include both your music files and the iTunes library files.
If you music is stored in other places, you need to backup those too. When you restore you need to ensure the full path name is the same.
Life is also much easier if you can keep exactly the same account name if you reinsall windows as the account name is part of the path to My Documents. -
Archive applet. Help with adding files to archive, then show.
I need help with this applet: http://pastebin.com/589064
The user is supposed to add, remove and open archives with text in it.
My problem is now the highlited area in the code (the lines with the @@'s).
This button should list all files i have added to the archive, however when i press the button, i only get a numberlisting. eg, if i have added 4 files to the archive I get: 0123
However I want the Joptionpane to show a listing of the files in the archive.
When I press "open" i can choose a file, press add, then open a new file, press add, and then when i click show archive, the filenames of the two files i added, should list through a Joptionpane..as you can see, i've tried, but i'm very unfamiliar with this.OK..i've done it
check out http://pastebin.com/589268
however, now i'd like to change the code, so that if i try to add to files with the same filename, the applet should show an error message..
How do i do that, please? :-) -
Urgent help with simple BPEL process for reading data from database
Hello there,
I need help with BPEL project.
i have created a table Employee in Database.
I did create application, BPEL project and connection to the database properly using Database Adapter.
I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
Can someone please describe me step by step what i need to do.
Thx,
DpsI have created a table in Database with data like Empno,name,salary,comments.
I created Database Connection in jsp page and connecting to BPEL process.
It initiates the process and it goes automatically for approval.
Please refer the code once which i created.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.Map" %>
<%@page import="com.oracle.bpel.client.Locator" %>
<%@page import="com.oracle.bpel.client.NormalizedMessage" %>
<%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
<%@page import="javax.naming.Context" %>
<%@page import="java.util.Hashtable" %>
<%@page import="java.util.HashMap" %>
<%@ page import="java.sql.*"%>
<%@ page import= "jspprj.DBCon"%>
<html>
<head>
<title>Invoke CreditRatingService</title>
</head>
<body>
<%
DBCon dbcon=new DBCon();
Connection conn=dbcon.createConnection();
Statement st=null;
PreparedStatement pstmt=null;
Hashtable env= new Hashtable();
ResultSet rs = null;
Map payload =null;
try
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
env.put("java.naming.security.principal", "username");
env.put("java.naming.security.credentials", "password");//bpel console
Locator locator = new Locator("default","password",env);
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
java.util.HashMap map = new HashMap();
st=conn.createStatement();
out.println("connected");
String query1="Select * from EMPLOYEE";
rs=st.executeQuery(query1);
/*reading Data From Database and converting into XML format
so that no need of going to BPEL console and entering the details.
while (rs.next()){
String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
"<Empno>"+rs.getString(1)+"</Empno>"+
"<EmpName>"+rs.getString(2)+"</EmpName>"+
"<Salary>"+rs.getString(3)+"</Salary>"+
"<Comments>"+rs.getString(4)+"</Comments>"+
"</AsynchBPELProcess1ProcessRequest>";
out.println(xml1);
nm.addPart("payload", xml1 );
// EmployeeApprovalProcess is the BPEL process in which human task is implemented
deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
// payload = res.getPayload();
out.println( "BPELProcess CreditRatingService executed!<br>" );
// out.println( "Credit Rating is " + payload.get("payload") );
//Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
catch(Exception ee) {
//("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
%>
</body>
</html>
Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this. -
Need help with adding images option
I was using the add images option a few weeks ago just fine.. using my tablet and uploading the images via usb. then all of the sudden it stopped working.
please help with this issue.
DannyA few questions. What result are you experiencing? Did PS Touch crash? Have you tried to force quit-and restart PS Touch? -Guido
-
Need help with adding to String members[];
Alright I am really confused about this now. lol.
Here is what I am wanting:
I need to get information from a txt file online, by rows, would look like this:
iy1175696721
yx1176164740
xm1176351702
I know I can do
String members[] = {"iy1175696721", "yx1176164740", "xm1176351702"};
But I want it to get that information from a txt file...
Here is what I found so far
URL memberList = new URL("http://www.example.com/text.txt");
URLConnection mc = memberList.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
mc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);Alright I am really confused about this now. lol.
Here is what I am wanting:
I need to get information from a txt file online, by
rows, would look like this:
iy1175696721
yx1176164740
xm1176351702
I know I can do
String members[] = {"iy1175696721", "yx1176164740",
"xm1176351702"};
But I want it to get that information from a txt
file...
Here is what I found so far
URL memberList = new
ew URL("http://www.example.com/text.txt");
URLConnection mc = memberList.openConnection();
BufferedReader in = new BufferedReader(
new
InputStreamReader(
c.getInputStream()));
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
de]Okay, so if I had to take a guess at this, your problem is that you can't create the array before reading the file, because you don't know how many lines are in the file?
You're best bet (unless the file is rediculously large) is to use an ArrayList so you can add the lines to the list one at a time, and the array list will take care of worrying about the size of the internal array.
- Adam -
I need help with Compressor 4 settings to convert .mp4 files to .m4v for iBooks Author
I'm a curriculum design guy with no video background. I have Compressor 4, but don't really know much about how to best use it. I'd appreciate some help with getting the right setting for my project. Screen shots of settings would be much appreciated, since I don't know much video terminology.
I'm making an free iBook for students on WWII propaganda using old videos from the Internet archive.
I'd plan to use Compressor to:
1. Convert the .mp4 files to a .m4v that iBooks Author will accept. (I know I can use QT for that, but it increases file size)
2. Use Compressor to reduce file size so my iBook doesn't get too big
3. Get videos that look & sound the best, given the poor quality of the original source videos.
Here's some sample videos that I'll use:
http://www.archive.org/download/OutOfTheFryingPanIntoTheFiringLine/OutOfTheFryin gPanIntoTheFiringLine.mp
http://archive.org/download/AvengeDe1942/AvengeDe1942_edit.mp4
PS - I will also be editing some of the original videos in iMovie - if I use different settings to prep those videos for iBook Author, let me know.
Much thanks in advance for any helpCompressor is half the size compared to QtX encoding, 17 MBs...
File Format... H.264 for Apple Devices...
Device: iPhone Local/WiFi
Aspect Ratio: 4:3 480x368
Data Rate: 700
Uncheck Multi-pass
Maybe you are looking for
-
Layout issue with Crystal Grouping
Dear all, I have created a report with Graph and the records on the group level. The data and graph is showing perfectly fine however the problem is the layout. Right after the graph, data starts to show up, which means, the data adjusts itself eithe
-
Crw32.exe has encountered a problem and needs to close
approximately every 1 and 1/2 to two months I have to uninstall Crystal Reports XI and re-load release 2. The program works fine then starts acting funny (cursor will not change when making text box longer/shorter, Can only make sections larger/shor
-
Just started using the new Macbook Pro I purchased and all was well until Update started installing the Intel OS 10.4.7 update. The system froze solid and that's the way it stayed for 45 minutes until my impatience took over and I powered-down. From
-
Hi, I am trying to update my ipad2 from ios 4.3.3 to ios 7.0.4 after i have downloaded the update it cant update my ipad it gave me error 3194 what can i do. Thanks
-
T43 – Model 1871-FU1: Will not boot with blank screen. Only Fan is running. Any ideas? Solved! Go to Solution.