An intro programming freshman needing help..
I'm a computer science freshman student and just starting out in my OOP class in JAVA. My class is using the Deitel book "How to Program in JAVA" 3rd ed. Although we are just beginning the course and have jst started working on arrays, I really wanted to get ahead of the class and work on the final project which is due in December. I wanted to create a page wizard that makes JSP pages, although the page wizard would be web-based. The page wizard would have templates like a main page, a form page and other types of content pages. Based on what I was reading in the New to JAVA technology posts.. I installed
Apache and Tomcat on my computer. I'm using broadband and have made my local machine a temporary host for this purpose. I am asking for advice as to how I should do my project. My professor isn't really helpful, which leads me to believe he doesn't really know the subject matter. I've heard I should use XML somehow but I don't know XML. Can anyone help me? Also, if anyone knows any good books or websites specifically on this subject I would really appreciate it!Thank you
Sincerely
Jose
PS. I'm also using Borland JBuilder 3(comes w/ book), but my professor is telling me to use Forte for JAVA, which I don't know to use and how to use it for my project as well. Which one should I use? And he suggested using a database to keep the templates of my pages and if people want to store their templates with a profile that includes login and passwords. What does that mean? Then how would I connect to a database? I only have Access on my computer and I don't know have SQL, Oracle, or mySQL nor do I know how to use any of them?
Actually I'm Filipino and don't speak spanish, sorry. That's ok abt. >those electronic books, if you know of any books or references >available in bookstores that would be helpful as well.
I looked at the link you gave me in the Sun WebSite. However can you >guide me a little further as to what topics I should look into?
Thanks
JoseBecaus eof your name I though you may be Spanish, as I'm. About the link it's to help you starting with XML, first try:
http://java.sun.com/webservices/docs/1.0/tutorial/doc/IntroXML.html
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPSAX.html
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM.html
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPIntro.html
In the order stated above, I think it's the logical order. After that you'll have enought criteria to know which path follow to know "the XML you need".
About electronical books, franklty, a good part of them I got them from from a website, which even I can't remember it, whwere I've got a password which allows you to see full books, the we employ an aracnic to automatize the download process, skip filters the have... blablabla
To short: you won't be able to download them (even now I can't download more).
Jose, you seem a good guy, if you sent me a FTP I wold send you books about XML, Java, and almost anything you were interested in. I can't allow you to download from my computeR: I'm under a firewall...
Tell me.
Abraham.
Similar Messages
-
Error at new statement on extended program check need help
Hi all ,
This is the code :
LOOP AT i_stocks INTO wa_stocks WHERE NOT pulkt IS INITIAL AND
NOT bstkt IS INITIAL AND
NOT fprctr IS INITIAL AND
( write_off_fix <> 0 OR
write_off_pup <> 0 ).
AT NEW fprctr.
CLEAR: l_prctrsum_fix, l_prctrsum_pup.
ENDAT.
IF wa_stocks-bukrs <> lastbukrs.
lastbukrs = wa_stocks-bukrs.
PERFORM document_header USING xreversal.
i_counter = 1.
CLEAR lastkostl.
ENDIF.
ADD wa_stocks-write_off_pup TO l_prctrsum_pup.
ENDLOOP
On Extended program check its says :
The LOOP statement processing will be limited
(FROM, TO and WHERE additions in LOOP)
Interaction with group change processing (AT NEW, ...) is undefined
(The message can be hidden with "#EC *)
It means at statement AT NEW fprctr .
Need help , How can i resolve this error ?
Regards .
Edited by: ujjwal dharmak on Feb 19, 2010 9:55 AM
Moderator message - Moved to the correct forum
Edited by: Rob Burbank on Feb 19, 2010 9:04 AMSince you are using where condition in loop statement and also using the control break statement thats why it is showing the error for you.
So if you want you can do like this
loop at itab into wa.
if not wa-f1 is initial ....<and other conditions>.
continue.
endif.
at new f1.
endat.
endloop.
It will resolve your problem but I am having the doubt how the at new will work properly...
Regards
Shiba Prasad Dutta -
Intro To Java Programming student needing help on how to download java SDK on 10.6.8
Hey Ladies and Gents,
For the past hour I have been trying to download Java SDK for my 10.6.8 Mac. Can someone point me in the right direction. I am taking a course in intro to Java programming and the book I am using isnt as helpful as I hoped.SE 6 development kits support SE 5 constructs. Just watch that you use only SE 5 constructs. Texts on 5 will not list the 6 constructs, and texts on 6 are available that tell what came when.
There is another forum (https://discussions.apple.com/community/developer_forums) where "developers" troll for questions to answer, and your developer questions will stay at the top of the list longer than in MacbookPro forum. -
New Java Programming Student Needs Help
Hey everyone,
I've just started taking a Java programming class at Penn State University, and I have had some prior experience with programming, i.e. C, C++, HTML, SQL. However, this will be my first attempt at Java. I know there are a lot of similarities between C++ and Java, but I'm still a little lost on some methodology.
To get myself going, I've been looking through the textbook a little and came across a problem that gave me some difficulty. I'll write out the outline:
A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and time and a half (i.e. 1.5 times their hourly wage) for overtime hours worked, commission workers (who receive $250 plus 5.7% of their gross weekly sales), and pieceworkers (who receive a fixed amount of money per item for each of the items they produce � each pieceworker in this company works on only one type of item).
+Define a Java class named EmployeePayment that includes functionality to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of employee has its own pay code: Managers have paycode 1, hourly workers have paycode 2, commission workers have paycode 3 and pieceworkers have paycode 4.+
+Define a main method that creates an instance of the EmployeePayment class, and calls the setManagerPay method to set the managers weekly salary to $625.00. The main method should then prompt the user for the paycode ��Enter paycode (-1 to end): �, validate the input and perform the associated processing for that paycode. Your program should allow the user to process employees until a paycode of -1 has been entered. Use a switch structure to compute each employee�s pay, based on the employee�s paycode. Within the switch, prompt the user (i.e. the payroll clerk) to enter the appropriate facts your program needs to calculate each employee�s pay based on that employee�s paycode, invoke the respective method (defined below) to perform the calculations and return the weekly pay for each type of employee, and print the returned weekly pay for each employee.+
+Define a setManagerPay method that accepts and stores the fixed weekly salary value for managers.+
+A private instance variable weeklyManagerPay should be defined in the EmployeePayment class to support these accessor and mutator methods.+
+Define a calcManagerPay method that has no parameters and returns the fixed weekly salary.+
+Define a calcHourlyWorkerPay method that accepts the hourly salary and total hours worked as input parameters and returns the weekly pay based on the hourly worker pay code description.+
+Define a calcCommWorkerPay method that accepts the gross weekly sales as an input parameter and returns the weekly pay based on the commission worker pay code description.+
+Define a calcPieceWorkerPay method that accepts the number of pieces and wage per piece as input parameters and returns the weekly pay based on the piece worker pay code description.+
+Once all workers have been processed, the total number of each type of employee processed should be printed. Define and manage the following private instance variables (*numManager*, numHourlyWorker, numCommWorker, and numPieceWorker) within the EmployeePayment class. What are the ways in which these variables can be updated?+
Sorry for the length, but I wanted this to be thorough. Basically, I'm having the most trouble writing the switch statement, and outputting the total number of each type of employee...
Any help and pointers will be greatly appreciated...thanks all.You said you've written C and C++ code before. I don't have an excellent memory but from the little code that I wrote in C, I believe the switch statement is exactly the same.
Read this: [http://java.sun.com/docs/books/tutorial/java/nutsandbolts/switch.html]
If you're having trouble understanding something post what your specific problem is. No one is going to write your homework for you, but many, myself included, would be more than willing to help if you're really stumped. Just post your concise problem.
Edited by: sheky on Mar 12, 2008 9:52 PM -
Need to install a mileage program and need help.
I need to install a mileage program on my ideapad S10. I have the cd and the code to make the program work. How do I get this installed on my Ideapad? Please give precise and clear directions. I don't want to screw this up and end up having problems. Any help is greatly appreciated. Thanks in advance.
1. Easiest way is to purchase or borrow an external CD player, of course, or
2. Contact the original company and pay to download an installable version.
3. Bring your S10 & CD to a local computer store. They should install your program for cheap.
4. Find a downloadable replacement mileage program online. Here is one..
http://download.cnet.com/Mileage-Calculator/3000-2064_4-10436153.html?tag=mncol -
Hi i just started programming in java.
im running j2se 1.5.0 on windows xp
im on the subject of classes and objects.
here is my simple little code im trying to get to compile
public class Newprog
public static void main(String[] args)
Greeter myObjectGreeter = new Greeter();
myObjectGreeter.sayHello();
}now here are the error messages i get:
--------------------Configuration: <Default>--------------------
C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol
symbol : class Greeter
location: class Newprog
Greeter myObjectGreeter = new Greeter();
^
C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol
symbol : class Greeter
location: class Newprog
Greeter myObjectGreeter = new Greeter();
^
2 errors
Process completed.
ok i get this error message alot....well actually just about everytime..
I got it working just once using texteditor but have no clue how i did it that time...now nomatter what i try i get this error
I have my enviornmental variable set at
path = C:\Program Files\Java\jdk1.5.0_07\bin;
i am using JCreator Le
i downloaded exact codes from websites and they still compile with this error..
if anybody with patience could tell me what i need to do
would i have to configure java some more with variables?
is my installation wrong?
do i have to save the work on a different file?
thanks in advanceHi i just started programming in java.
im running j2se 1.5.0 on windows xp
im on the subject of classes and objects.
here is my simple little code im trying to get to
compile
public class Newprog
public static void main(String[] args)
Greeter myObjectGreeter = new Greeter();
myObjectGreeter.sayHello();
}now here are the error messages i get:
--------------------Configuration:
<Default>--------------------
C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5:
cannot find symbol
symbol : class Greeter
location: class Newprog
Greeter myObjectGreeter = new
Greeter();
^
s\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find
symbol
symbol : class Greeter
location: class Newprog
Greeter myObjectGreeter = new
Greeter();
^
get this error message alot....well actually just
about everytime..
I got it working just once using texteditor but have
no clue how i did it that time...now nomatter what i
try i get this error
I have my enviornmental variable set at
path = C:\Program Files\Java\jdk1.5.0_07\bin;
i am using JCreator Le
i downloaded exact codes from websites and they still
compile with this error..
if anybody with patience could tell me what i need to
do
would i have to configure java some more with
variables?
is my installation wrong?
do i have to save the work on a different file?
thanks in advance
Well here is all that goes
As you said you were pretty new
I suspect the following error done by most of the novice programmers in JAVA
Where is the Greeter class ??
ok may be you must have defined it somewhere else
Mostly the Java Compiler hasnt found out your Greeting class
Try locating that " Greeter.java"
or mention it in an other file located in the same folder as "Newprog.java"
public class Newprog
public static void main(String[] args)
Greeter myObjectGreeter = new Greeter();
myObjectGreeter.sayHello(); -
Need to find program, desperately need help.
A few months ago, I had a problem. My PC wouldn't recognize my external hard drive. On a forum, I found a link to a program written by an individual which would recognize drives that the system wouldn't recognize. This program could be used for recovering files, but was especially used to recover picture files.
Let me explain a bit. In two weeks, I lost three computers. First, I reloaded XP on my Thinkpad. When I tried to reload my data from my external hard drive, the hard drive wasn't recognized by my Thinkpad. Somewhere in a forum post, I found a link to this wonderful program which allowed me to restore my data.
Next, my mother-in-law's PC died (first PC lost). Crashed hard drive, no backup. With this same program, I was able to recover her data. Next, my desktop hard drive failed (second PC lost). No real problem. It was a 2005 PC, and I had everything backed up to my external hard drive, and thus to my Thinkpad.
Then my Thinkpad died (third PC lost). Bad motherboard. But all my data was on that PC!! I have resurrected a desktop from the carcass of my mother-in-law's PC by installing an older hard drive, but my data is still trapped on the external hard drive. And I don't know where the program was I used to restore it last time.
Does this program sound familiar to anyone? It was simple to run and worked very well. I believe I had info about it - on my Thinkpad. Any help would be appreciated. I believe it had a very simple name such as "test disk" or something similar. Help!! Thanks!Thank you all!! Yes, I'm looking for TestDisk. Got all my data back! Yeah!!
-
My j2me program hangs --need help
hi.my program hangs whenever i run my midlet and i get a message like this
Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.
below is my codes
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;
import javax.microedition.io.file.*;
import javax.microedition.io.*;
public class TCPClient extends MIDlet implements CommandListener ,ItemCommandListener {
private Display display;
private Form form;
private Command exit,set;
private TextField txtField;
private ChoiceGroup sImage;
private int sIndex;
private String strTxtField;
private Image image;
public TCPClient(){
display=Display.getDisplay(this);
form=new Form("TCPClient");
txtField=new TextField("type what u want to send",null,30,TextField.ANY);
sImage= new ChoiceGroup("pls select", Choice.EXCLUSIVE);
sImage.append("no image",null); //=0
sImage.append("image",null); //=1
exit=new Command("Exit",Command.EXIT,1); //1= highest priority,
form.append(txtField);
form.append(sImage);
form.addCommand(exit);
form.setCommandListener(this);
try{
Image image= Image.createImage("/send.jpg");
ImageItem imageItem=new ImageItem(null,image,Item.LAYOUT_CENTER ,null,Item.BUTTON);
set =new Command("Set", Command.ITEM, 1);
imageItem.setDefaultCommand( set);
imageItem.setItemCommandListener(this);
form.append(imageItem);
}//end of try
catch(IOException e){System.out.println("button error");}
}// end of constructor
public void startApp(){
System.out.println("midlet started");
ItemStateListener listener = new MyStateListener();
form.setItemStateListener(listener);// register for events
display.setCurrent(form);
public void pauseApp(){}
public void destroyApp(boolean unconditional){}
public void commandAction(Command c, Displayable s){
if(c==exit){
destroyApp(false);
notifyDestroyed();
} // end of commandAction
public void commandAction(Command c, Item item){
if(c==set){
strTxtField=txtField.getString();
System.out.println(strTxtField);
try {
String filename = "file:///root1/commands.txt";
byte[] data = strTxtField.getBytes();
FileConnection filecon = (FileConnection)Connector.open(filename,Connector.READ_WRITE);
// Always check whether the file or directory exists.
if(!filecon.exists()) {
filecon.create();
OutputStream outputStream = filecon.openOutputStream();
outputStream.write(data);
outputStream.close();
filecon.close();
} catch(IOException ioe) {
}//end of set
}//emd of commandAction method
private class MyStateListener implements ItemStateListener
boolean pictureIsShown=false; //Remember the state
int pictureIndex; //Remember the index
public void itemStateChanged(Item item)
if(item==sImage){
sIndex=sImage.getSelectedIndex();
switch(sIndex){
case 0:System.out.println(sIndex);
if (!pictureIsShown){
form.delete(pictureIndex);}
break; // end of case0
case 1:System.out.println(sIndex);
if (!pictureIsShown){
try{
ImageItem logo= new ImageItem("",Image.createImage ("/misa.jpg"), ImageItem.LAYOUT_CENTER,"");
pictureIndex=form.append(logo);
System.out.println("success");
catch(IOException e)
{System.out.println("error");}}//end of if
break;
default: System.out.println("kiss my ___");
}//end of switch
}//end of if
//do something
}//donttouch
}whenever it runs,it would hangs if i enable it to read my codes.
any help/advise is greatly appreciate.thanksHi
Use thread while creating a connection -
http://forum.java.sun.com/thread.jspa?threadID=5119680
Check this link, ll get an idea - how you can use thread?
Rohan Chandane -
C# Programming - I Need Help Putting a Loop into this Program!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Homework_2
class Program
static void Main(string[] args)
Console.WriteLine("Enter the First Value:");
var number1StringValue = Console.ReadLine();
Console.WriteLine("Enter the Second Value");
var number2StringValue = Console.ReadLine();
var number1 = Convert.ToDouble(number1StringValue);
var number2 = Convert.ToDouble(number2StringValue);
var sum = number1 + number2;
var difference = number1 - number2;
var product = number1 * number2;
var quotient = number1 / number2;
var remainder = number1 % number2;
Console.WriteLine("The Sum Is:");
Console.WriteLine(sum);
Console.WriteLine("The Difference Is:");
Console.WriteLine(difference);
Console.WriteLine("The Product Is:");
Console.WriteLine(product);
Console.WriteLine("The Quotient Is:");
Console.WriteLine(quotient);
Console.WriteLine("The Remainder Is:");
Console.WriteLine(remainder);
string answer;
Console.Write("Would You Like to Calculate More Numbers? Type: [Yes] or [No]");
answer = Console.ReadLine();
if (answer.Equals("Yes", StringComparison.InvariantCultureIgnoreCase))
Console.WriteLine("You Answered: Yes... The Program Will Continue");
Console.WriteLine("Not Really, I do not have enough knowledge to make this Program Loop, Sorry.");
Console.WriteLine("Press Any Key To Continue!");
Console.ReadKey();
// THIS IS WHERE I NEED THE PROGRAM TO LOOP AGAIN.
else if (answer.Equals("No", StringComparison.InvariantCultureIgnoreCase))
Console.WriteLine("You Answered: No... Press Any Key To Stop Program");
Console.ReadKey();
}static void Main(string[] args)
bool done = false;
while( !done )
Console.WriteLine("Enter the First Value:");
var number1StringValue = Console.ReadLine();
Console.WriteLine("Enter the Second Value");
var number2StringValue = Console.ReadLine();
var number1 = Convert.ToDouble(number1StringValue);
var number2 = Convert.ToDouble(number2StringValue);
var sum = number1 + number2;
var difference = number1 - number2;
var product = number1 * number2;
var quotient = number1 / number2;
var remainder = number1 % number2;
Console.WriteLine("The Sum Is:");
Console.WriteLine(sum);
Console.WriteLine("The Difference Is:");
Console.WriteLine(difference);
Console.WriteLine("The Product Is:");
Console.WriteLine(product);
Console.WriteLine("The Quotient Is:");
Console.WriteLine(quotient);
Console.WriteLine("The Remainder Is:");
Console.WriteLine(remainder);
string answer;
Console.Write("Would You Like to
Calculate More Numbers? Type: [Yes] or [No]");
answer = Console.ReadLine();
if (answer.Equals("Yes", StringComparison.InvariantCultureIgnoreCase))
Console.WriteLine("You
Answered: Yes... The Program Will Continue");
Console.WriteLine("Not
Really, I do not have enough knowledge to make this Program Loop, Sorry.");
Console.WriteLine("Press
Any Key To Continue!");
Console.ReadKey();
// THIS IS WHERE I NEED THE PROGRAM TO LOOP AGAIN.
else if (answer.Equals("No",
StringComparison.InvariantCultureIgnoreCase))
Console.WriteLine("You
Answered: No... Press Any Key To Stop Program");
Console.ReadKey();
done = true; -
College program assignment need help please!!!!!
I have to write a java class called Factor Number that gets a whole number from the user and determines its divisors. It should return the results in a dialog box with a message like: The factors of 25 are 1,5,25.
My problem is that I can do the simple items but I don't know how to set up the math or loops to get my program to check the factors for me. Can anyone help me with this it would be awsome. what loops to use and how to get it to do factors I have looked all over the web for sample code with no luck this is my last shot for someone out there to help me get this thing started. thanks if you respond!!!!!!try this:
import java.io.*;
class FactorNumber
public static void main(String[] args)
int base = 0;
try{
System.out.println("Enter the base : \t " );
BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
base = Integer.parseInt(br1.readLine());
for(int x=1;x<=base; x++ ){
if(base%x==0){System.out.print(x+" ");}
}catch (IOException e){System.out.println("The error" + e);}
} -
HP Buy back program pricing; need help
I was thinking of getting a new desktop and selling my old one back to HP but their buyback program doesn't have some of my spec and {i was wondering if anyone would know the estimate on how much I would get back and how to contact HP about it.
Here are my pc specs.
HP Pavilion p7-1074 Desktop
Thanks in advance!
This question was solved.
View Solution.Please read these FAQs concerning the HP Buy Back program. Based on the specs of your computer and the nearest available selections on the estimator, your computer is worth about $50 to $62. You may wish to contact the programs customer service number;
How do I contact customer service?
If you have questions about any part of the process, please contact customer service or call 1-888-285-2009 Monday - Friday, 8:00 AM to 8:00 PM Eastern Standard Time.
Please send KUDOs
Frank
{------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
This is a user supported forum. I am a volunteer and I don't work for HP.
HP 15t-j100 (on loan from HP)
HP 13 Split x2 (on loan from HP)
HP Slate8 Pro (on loan from HP)
HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240 -
I am a noob to programing / i need help with exceptions
HI
I am a beginner at programming, and wondering if some one could help me out on this program. Its an address book program I got everything to work the only problem is that I haven�t been able to do this step.
Handle all exceptions properly...
If there is a null in an element in an array.
If the user enters an incorrect data type in a dialog box
(e.g. Enters a letter where a number was expected, or
enters numbers where letters were expected.
I am using the JOptionPane input boxes to receive the info.
If some one could send me a code example on what I am to do that would help a lot.
Also if some one can explain to me what exceptions are and how the code sample works that would be even better.
thanx for all the helphttp://java.sun.com/docs/books/tutorial/essential/exceptions/
-
I have a Windows ME program. Need help please
I am trying to install the cd software and computer is giving me an error on the download. SP4 2000 or XP needed. Is this true? Do I need to change my system in order to use an Ipod?
You can't use iTunes or the iPod Updater utility unless you upgrade your operating system.
There are some third-party alternatives to iTunes, such as XPlay2, which supposedly runs on Windows ME.
Using this software isn't supported by Apple, or these forums. It would be a use at your own risk type of thing.
Upgrading your operating system will offer the best solution to your problem.
If you choose not to, then you are forced to use alternative software which may degrade your user experience with the iPod. You wouldn't have access to the iTunes Music Store to purchase music or videos without using iTunes. -
Extended Program check: Need help with error messages
Hi,
I am getting the following error message several time on different internal table declarations:
"Tables with headers are no longer supported in the OO context."
This is the data declaration that it refers to:
I_ZDAILY_MVMT TYPE TABLE OF ZDAILY_MVMT WITH HEADER LINE.
Also, I am getting the following:
You cannot use the "RANGES" statement within classes. Instead, use the "DATA"
statement with the type "TYPE/LIKE RANGE OF" . . . . . . . . .
This is for the following data declaration:
RANGES: I_WERKS FOR EBAN-WERKS, "PLANT RANGE
I_VTWEG FOR I_TVTW-VTWEG,
I_VTWEG2 FOR I_TVTW-VTWEG,
I_VKORG FOR I_TVKO-VKORG,
I_AUART FOR I_TVAK-AUART.
What do I change and then how do i populate them?
Thanks,
John
Message was edited by:
John DamionWe dont use tables with header lines any more.
Declare a work area and use it transfer the data.
e.g.
types: types_ZDAILY_MVMT TYPE standard table of TABLE OF ZDAILY_MVMT.
data: I_ZDAILY_MVMT TYPE type_ZDAILY_MVMT,
wa_zdaily type zdaily_mvmt.
Now use this work area to move data into the table.
Regards,
Amit
Reward all helpful replies. -
I have this program done but when I try to run it wouldnt work
What I have to create to make it work
Thanks
import java.awt.Graphics;
import java.awt.Color;
public class Building
private final int DEFAULT_WIDTH = 50;
private final int DEFAULT_HEIGHT = 100;
private final int DEFAULT_WINDOWS = 5;
private final int WINDOW_SIZE = 5;
private int width, height, windows;
// Sets up this Building based on default values.
public Building ()
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
// Constructor: Sets this Building's size.
public Building (int buildingWidth, int buildingHeight)
width = buildingWidth;
height = buildingHeight;
// Returns the width of this building.
public int getWidth ()
return width;
// Draws the building.
public void draw (Graphics page, int leftedge, int bottom)
int winX, winY;
int top = bottom - height;
page.setColor (Color.black);
page.fillRect (leftedge, top, width, height);
// Draw three windows in random locations
page.setColor (Color.yellow);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
}HI, This might work.
publi class Building{
public static void main(String args[]){new Building1();}
class Building1
private final int DEFAULT_WIDTH = 50;
private final int DEFAULT_HEIGHT = 100;
private final int DEFAULT_WINDOWS = 5;
private final int WINDOW_SIZE = 5;
private int width, height, windows;
// Sets up this Building based on default values.
public Building ()
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
// Constructor: Sets this Building's size.
public Building (int buildingWidth, int buildingHeight)
width = buildingWidth;
height = buildingHeight;
// Returns the width of this building.
public int getWidth ()
return width;
// Draws the building.
public void draw (Graphics page, int leftedge, int bottom)
int winX, winY;
int top = bottom - height;
page.setColor (Color.black);
page.fillRect (leftedge, top, width, height);
// Draw three windows in random locations
page.setColor (Color.yellow);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
winX = leftedge + (int) (Math.random() * (width-WINDOW_SIZE));
winY = top + (int) (Math.random() * (height-WINDOW_SIZE));
page.fillRect (winX, winY, WINDOW_SIZE, WINDOW_SIZE);
}
Maybe you are looking for
-
Cannot see my attached doc in file attachment list
Hi all, I used the code below to attach a doc to a pernr. After attaching a PDF document to pernr 00070845, I goto transaction PA20/PA30 to see the attachment list. However, I cannot manage to see the doc in the attachment list. Idoublle check that t
-
Problem in plugin oracle database in eclipse Galileo
Hi guys, I am new to Oracle and trying to plugin database in eclipse Galileo. I found the following tutorial http://download.oracle.com/docs/cd/E14545_01/help/oracle.eclipse.tools.database.doc/html/gettingStarted/files/gettingStarted.html I have down
-
Please help; how to write XML document with JSP?
I try to write XML document with JSP... But I got wrong results everytime. The result is not XML file displayed in the browser, but HTML file. I even tried to use HTML special code for <, >, " but still display as HTML file not XML file. How to do th
-
Hello Guru's, How to setup default value to a field
Hello Guru's,, will anyone guide me the procedure how to setup a default value to a field in mm01 SAP STD Transaction. example: material description ' xxxxxxx ' , it should be constant for all materials. full points for the answer PV
-
Weird character while printing amount field in ADOBE form
When amount field is set for any diplay pattern in PDF form it is displaying like ¤7.41. All display patterns are tried leading to same display. All display patterns show the first character as $, but displays this weird character '¤'. Advice me ho