| CLASSPATH clobbering, win2k |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- Bug#398510: No longer active on this task.retitle 398510 RFP: openjdk-hotspot-jvm -- Hotspot JVM from Sun
retitle 398448 RFP: openjdk-compiler -- sun java compiler, javac
thanks
Hi
I'm no longer active on this task so I rename it to RFP. However
other people should be able to start from where I stopped so
I have uploaded the files to:
http://debian.opal.dhs.org/java-jdk-dev
Best regards,
// Ola
--
--- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/ email***@***.com Annebergsslingan 37 \
| email***@***.com 654 65 KARLSTAD |
| http://opalsys.net/ Mobile: +46 (0)70-332 1551 |
\ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
---------------------------------------------------------------
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 4
- void methods and "return"hi,
void methods cannot return values, however, i noticed that i can still
use "return" without any value to exit a method like this:
public void myMethod(int arg0)
{
if (arg0 == 0) return;
...
}
question: is the above ok or will i get errors with other java versions.
i'm using jre1.4.1_02 in eclipse.
thx!
- 6
- Java and colour management...I have colour profile applied to my monitor.
When I browse a website that needs the Java plugin to run, it removes the
colour corrections making my display too bright! WHY the hell does java do
anything to my display???
Thanks.
- 6
- [ANN] DBPool : JDBC Connection Pooling - v4.7.2 released
A new version of DBPool has been released (v4.7.2), and is available for
download from http://www.snaq.net/java/DBPool/
DBPool is a pure-Java library for the pooling of JDBC connections for
applications that require high performance database access.
Features include:
* Pool Manager to allow easy configuration and/or quick startup
* User-configurable pools to achieve high performance
* Caching of statements to provide maximum performance
* Multiple connection pools simultaneously
* User-definable connection validation allows increased reliability
* Connection limit allows constraining to database licence restrictions
* Improved performance through caching of statements
* It's FREE, and source code is included
DBPool has been used in many large-scale commercial applications
throughout it's lifetime and various stages of development, on both
Solaris and Windows deployment platforms.
Stan
- 6
- 7
- Java process title editingI need a component that takes a String and puts it into Unix process
table by calling natively setproctitle. On Windows it can do nothing, I
don't care.
Also a possibility to use variables such as number_of_threads would be cool.
Why? When running a lot of Java server stuff on a Linux box it's really
hard to tell which process is which. Especially in production
environment "kill -9":ing makes me always feel quite uncomfortable...
If there is no such thing, then I'll have to roll my own. But better to
check first, don't wan't to reinvent stuff. :) Google didn't turn out
anything. ..
- 7
- i am new to javaIn article <eje544$gkc$email***@***.com>, Prejith took
the hamburger meat, threw it on the grill, and I said "Oh Wow"...
> hello
>
> i am new to java programming..since it is a requirement for my task i am
> suppose to write java jobs..i had a small training in core java concepts for
> 3 days..
>
> my question here is i am suppose to use some file handling and exception
> handling in my programme..can you help me with the above mentioned
> concepts...
>
> Regards
> Prejith
Okay, it breaks down like this. File handling is just that, things you
want to do to a file. You can read files and write to them. Whenever
you read to or write from a file, you have to handle exceptions, the
main one being FileNotFoundException (in case there's no file to be
found). That's why they want to empahasize both of those points.
Whenever you're doing I/O, you have to use try/catch blocks. I think
I/O exception's the other one you have to handle but my memory is
fuzzy on it right now.
HTH
--
trippy
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM
NP: "All I Really Want" -- Alanis Morissette
"Now, technology's getting better all the time and that's fine,
but most of the time all you need is a stick of gum, a pocketknife,
and a smile."
-- Robert Redford "Spy Game"
- 7
- creating classes dynamicallyHI is it possible to create classes dynamically and if so how? What im
trying to do is have a user enter names into a textbox and use these
names to create instances of classes dynamically. the code below doesnt
work once never mind for numerous classes?????
String help= TextField.getText();
help = new SOP();
cheers
- 7
- Hiring Sr. Java Tool EngineerGood afternoon my name is Jason and I am a recruiter. My client is
currently seeking 3 Sr. Java Tool Engineers immediately! We are
looking for software engineers with SDLC and BCI experience.
The position is located in the Northern California area and the
company, which I can not disclose at the moment, is a groundfloor
cutting edge software application company that recently secured top
tier Venture Capital Funding. The salary range is $90k-125k and the
benefits include Medical, a great work environment and Pre-IPO Stock
Options. Company will relocate and sponsor/transfer VISAs.
If you are interested in getting more information about this position
please email me at email***@***.com and if possible please
include your resume for review. Thank you and Good Luck!
- 9
- tomcat authentication questionI'm fairly new to configuring server.xml and web.xml files in tomcat 4.
I am trying to require password authentication for access to a
subdirectory called "update" located within ROOT. I want all files
located directly in ROOT to be available without a password. I am having
trouble determing the correct path to use for the <url-pattern> in the
web.xml file in WEB-INF so that only the files in the subdirectory
"update" within ROOT are password protected.
If I use <url-pattern>/*</url-pattern> then no pages on the site may be
accessed without a password no matter their location. I am presuming
that this means I have set up the basic authentication correctly in
tomcat-users.xml, server.xml (in conf) and web.xml (in WEB-INF) but that
I now simply need to put the correct path into the <url-pattern> in
web.xml.
However, when I use <url-pattern>/update/*</url-pattern>, I can access
all of the pages within the update directory without being asked for a
password. I've experimented with many different paths and have not had
luck with any. I have been careful to close my browser and open a new
one each time between tests. I've also tried restarting tomcat for every
new test. Nothing works.
In my server.xml file, <Realm
className="org.apache.catalina.realm.MemoryRealm" /> is located within
the <Engine> tag (not within <Host> or <context>).
Have hunted around for a solution without much luck. I assume that I am
missing something very simple.
Here is my complete web.xml file...
<web-app>
<display-name>SMUpdate App webxml</display-name>
<!-- form login security tags -->
<security-constraint>
<web-resource-collection>
<web-resource-name>SMUpdate</web-resource-name>
<url-pattern>/*</url-pattern> <!-- this works but causes password
to be required for access to all pages on entire site -->
</web-resource-collection>
<auth-constraint>
<role-name>smupdate</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>SMUpdate</realm-name>
</login-config>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
</web-app>
Any suggestions would be very much appreciated.
Thanks.
- 13
- Java coding with Agile PLM SDK - QuestionHello,
I was wondering if any one out here is dealing with a PALM System called
Agile and has some experience with the Agile SDK. If so can you email me, I
have a question on the SDK.
Also if any one know where I might find like a forum or message board that
deals with The Agile PALM system that would be help full too.
Thanks
-Dale
- 13
- Graphics2D question.Hello,
I want to build my application from three main classes.
1. A frame class to handle file operations.
2. A Drawing panel to render images to.
3. An engine to perform the actual rendering.
All the examples I have read so far for Image stuff in Java have
everything stuffed into one monolithic class, and the crux of the
rendering seems to be done in paint(Graphics g) or
paintComponent(Graphics g) using a g2d object cast againg the parameter g.
If I wanted to do calculations for rotations translations etc I can do
this with the AffineTransform class setX methods, but the drawImage
method of g2d seems to be handled in the paint/paintComponent methods.
This is fine until I want to specify x, y arguments in the drawImage
Method as neither Paint or PaintComponent take these parameters in their
method signature how can I do this, is there another way to draw apart
from the paint/paint component methods?
Any help appreciated.
- 13
- Where's the source for midpapi.zip?OK - I give up - what has Sun done with the source to "midpapi.zip"?
I'm usting the WTK, 2.0.
Thanks in advance for any assistance.
--
__________
|im |yler http://timtyler.org/ email***@***.com
- 14
- Middle Tier for Java and PHPHi,
Let's say you have a Java SE Application and a PHP Web App that are both
accessing a database directly. You want to control things more formally
by using a common middle tier (enforcing things in addition to database
constraints / sprocs).
Any experience on what works and/or recommendations?
Thanks,
John
- 16
- servlet mapping problemsHey guys/gals. My first attempted at servlet mapping flubbed.
Background:
A friend at work suggested I store my source in webapps\wbrl\jsp
So I have Tomcat\webapps\wbrl\jsp\WebRoll.jsp
Currently I type http://localhost:8080/wbrl/jsp/WebRoll3.jsp
This brings up my application successfully.
I would like to be able to type http://localhost:8080/wbrl and have
it bring up my web page.
So I tried to change the web.xml, but it doesnt work.
<servlet>
<servlet-name>WebRoll3</servlet-name>
<servlet-class>WebRoll3</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WebRoll3</servlet-name>
<url-pattern>/wbrl/*</url-pattern>
</servlet-mapping>
<url-pattern>/wbrl/*</url-pattern> causes "Wrapper cannot find servlet
class WebRoll3 or a class it"
How do i fix this? Do I use filter mapping? I got totally lost in the
filter mapping explanation.
|
| Author |
Message |
thufir

|
Posted: 2004-12-29 5:27:00 |
Top |
java-programmer, CLASSPATH clobbering, win2k
from <http://java.sun.com/j2se/1.4/install-windows.html#Environment>:
"Choose Start, Settings, Control Panel, and double-click System. On
Microsoft Windows NT, select the Environment tab; on Microsoft Windows
2000 select the Advanced tab and then Environment Variables. Look for
"Path" in the User Variables and System Variables. If you're not sure
where to add the path, add it to the right end of the "Path" in the
User Variables."
under System Variables the value of "Path" is:
"C:\Program Files\Java\jdk1.5.0\bin\"
from
<http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#2c>
I followed these instructions:
"If you still have problems, you might have to change your CLASSPATH
variable. To see if this is necessary, try "clobbering" the classpath
with the following command:
set CLASSPATH="
"clobbering" fixed the problem, "java HelloWorldApp" worked fine.
However, since I need to clobber the CLASSPATH variable I need to
change it's value, but to what, pls?
thanks,
Thufir
|
| |
|
| |
 |
jeffc

|
Posted: 2004-12-29 5:31:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
"thufir" <email***@***.com> wrote in message
news:email***@***.com...
> from
> <http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#2c>
> I followed these instructions:
>
> "If you still have problems, you might have to change your CLASSPATH
> variable. To see if this is necessary, try "clobbering" the classpath
> with the following command:
>
> set CLASSPATH="
>
> "clobbering" fixed the problem, "java HelloWorldApp" worked fine.
> However, since I need to clobber the CLASSPATH variable I need to
> change it's value, but to what, pls?
Well, if you want to leave it like that for future use, you would simply not set
it. In the same place where you found "Path", you should find "ClassPath" (case
is not important). Just delete it with the Delete button.
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-29 6:18:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
thanks :)
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-30 6:42:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
I'm getting the same error again:
C:\java\HelloWorldApp\src>set CLASSPATH=
C:\java\HelloWorldApp\src>javac HelloWorldApp.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
from start/settings/control panel/system/advanced/environmental
variables/system variables
ANT_HOME
C:\ant
JAVA_HOME
C:\ProgramFiles\Java\jdk1.5.0
PATH
PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
I don't see a CLASSPATH variable, if that matters?
thanks,
Thufir
|
| |
|
| |
 |
Liz

|
Posted: 2004-12-30 6:59:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
On 29 Dec 2004 14:41:50 -0800, thufir wrote:
>C:\java\HelloWorldApp\src>javac HelloWorldApp.java
>'javac' is not recognized as an internal or external command,
>operable program or batch file.
>
>PATH
>PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
>
What is JAVA_HOME? Is that the actuan name of your java folder? Mine
is c:\j2sdk1.4.2_05, so what I put in the path is
c:\j2sdk1.4.2_05\bin
along with other essential folders, separated by semicolons as you
show above.
It seems to me that might be one place where things could fall apart.
Oh, and I think there should be another % sign in front of PATH% (to
preserve the pre-existing path when you add the java additions to it).
hth
--
Liz
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-30 7:25:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
ANT_HOME
C:\ant
JAVA_HOME
C:\Program Files\Java\jdk1.5.0
PATH
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
is the correct info, sorry 'bout the typos :)
-Thufir
|
| |
|
| |
 |
ge0rge

|
Posted: 2004-12-30 7:33:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
"thufir" <email***@***.com> wrote
...
> C:\java\HelloWorldApp\src>javac HelloWorldApp.java
> 'javac' is not recognized as an internal or external command,
> operable program or batch file.
...
> JAVA_HOME
> C:\ProgramFiles\Java\jdk1.5.0
>
> PATH
> PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
Looks like a % is missing before the PATH%
To check that your PATH variable is correctly set up, open a command prompt
window and type -
echo %PATH%
and if you don't see C:\ProgramFiles\Java\jdk1.5.0\bin somewhere in there,
your path is still not set correctly.
--
There is very little future in being right when your boss is wrong.
|
| |
|
| |
 |
ge0rge

|
Posted: 2004-12-30 7:48:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
"thufir" <email***@***.com> wrote
...
> JAVA_HOME
> C:\Program Files\Java\jdk1.5.0
>
> PATH
> %PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
> is the correct info, sorry 'bout the typos :)
In that case, check that you have not made another typo by navigate to
C:\Program Files\Java\jdk1.5.0\bin (to make sure that the directory actually
exists)
Better still, to avoid the hassle (of figuring whether %JAVA_HOME% is
defined at the time substitution takes place), explicitl;y set your PATH to
where you know where your java compiler is eg.
%PATH%;C:\Program Files\Java\jdk1.5.0\bin; etc...
... and the run the echo command (in my previous mail) to make sure
everything is as expected.
--
Every man thinks God is on his side. The rich and powerful know that he is.
-- Jean Anouilh, "The Lark"
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-30 8:23:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
ANT_HOME
C:\ant
JAVA_HOME
C:\Program Files\Java\jdk1.5.0
PATH
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
is the correct info, sorry 'bout the typos :)
-Thufir
|
| |
|
| |
 |
jeffc

|
Posted: 2004-12-30 12:18:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
"ge0rge" <email***@***.com> wrote in message
news:email***@***.com...
>
> To check that your PATH variable is correctly set up, open a command
prompt
> window and type -
> echo %PATH%
Or much easier to remember, simply
set path
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-30 13:28:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
ge0rge wrote:
[..]
> Better still, to avoid the hassle (of figuring whether %JAVA_HOME% is
> defined at the time substitution takes place), explicitl;y set your
PATH to
> where you know where your java compiler is eg.
> %PATH%;C:\Program Files\Java\jdk1.5.0\bin; etc...
[..]
old value for PATH:
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
current value for PATH:
%PATH%;C:\Program Files\Java\jdk1.5.0\bin;%ANT_HOME%\bin
C:\Program Files\Java\jdk1.5.0\bin is indeed the location for the jdk.
somewhat negates the point of having JAVA_HOME and ANT_HOME by
explicitly setting the PATH, but there you are.
ok, javac works again, thanks :)
-Thufir
|
| |
|
| |
 |
ge0rge

|
Posted: 2004-12-30 16:05:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
"thufir" <email***@***.com> wrote
...
> somewhat negates the point of having JAVA_HOME and ANT_HOME by
> explicitly setting the PATH, but there you are.
> ok, javac works again, thanks :)
PATH=%JAVA_HOME%
JAVA_HOME=xyz
might not set the PATH correctly but reversing the order of these statements
probably will. It depends on the order the OS is reading the variables and
doing the substitution.
In any case, leave your JAVA_HOME set as it may be used by other software
eg. ant or j2ee
--
If you sow your wild oats, hope for a crop failure.
|
| |
|
| |
 |
thufir

|
Posted: 2004-12-31 19:33:00 |
Top |
java-programmer >> CLASSPATH clobbering, win2k
heh, that's fundamental and yet...silly! the way the GUI presents the
var's implies, to me, that the order wouldn't matter, and yet, it does.
javac's broken again, but jEdit compiles stuff fine, so...the saga
continues for largely unknown (to me) reasons.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Setting Appender's fields in Apache's Log4JHi,
In the following code snippet (which is written to create a
FileAppender & make log4J log to that file):
import org.apache.log4j.*;
class sample
{
....
HTMLLayout layout = new HTMLLayout();
layout.TITLE_OPTION = "DataSE Log";
String logFileName = "Log.txt";
Appender appender = new FileAppender(layout, logFileName, true);
appender.immediateFlush = false;
appender.bufferedIO = true;
appender.bufferSize = 64;
Logger logger = Logger.getLogger();
logger.addAppender(appender);
.....
}
the above snippet is not inside any method. Its directly within the
class. In the above snippet, I am encountering 2 types of errors:
1. Am using the fields of the classes FileAppender & layout. The usage
seems to be wrong, because am getting the error "'synatx error on
token(s); misplaced construct(s)" & similar errors.
2. how to specify the bufferSize? Just as '64' or '64K'?
Thanks.
- 2
- singlethreadmodel vs. synchronizeI have a book that is explaining servlets and implements
singlethreadmodel instead of using synchronize with wait and notify.
does that only work with servlets? which is better?
- 3
- Need convert to postscript before printing?I want to print files which are stored in a folder. From many forum, i
found that printer can only receive postscript format, and if i want to
print pdf or microsoft office files, i need to convert it to postscript
before send to printer.
Am i right? Can anyone gives opinion how to make it simple?
- 4
- 5
- Eclipse Tomcat Project StructureHi All,
I am using Eclipse 3.0 with a Tomcat plug in.
I am trying to create multiple web projects using Tomcats webapps
directory. Eclipse will let me set up one project with under the webapps
folder but when I try to add a new project I get the following error
C:/jakarta-tomcat-4.1.30/webapps and C:/jakarta-tomcat-4.1.30/webapps
overlap.
This I am sure will have a simple explanation... I am thinking that it
should be ok to work on multiple web projects with different names at the
same time under Tomcats webapps folder ?
Thanks in advance
Jim
- 6
- most software jobs are software maintenance rather than new development?
>> If the code were written with copious unit tests, and if they still
>> passed no matter how old the original effort, then you don't need such
>> expertise to maintain it.
>Dubious at best. Obviously you only have read well written/refactored code
I think someone can only see the world through TDD glasses :)
-Scott Frye
"aut viam inveniam aut faciam"
- 7
- 8
- eclipseJohn Bailo wrote:
> http://www.eclipse.org
>
The Eclipse IDE is very huge and bloated. You might
want to take a look at one of these alternatives:
http://jedit.org
Supports several development languages and a huge
assortment of feature plugins. You can script out
your own shell tools as macros and make them available
as buttons on your toolbar.
http://netbeans.org
Similar to JEdit but with a GUI designer for Java apps.
Also lots of plugins and multi-language support.
The nice thing about having IDEs written in Java is
the cross-platform support; using the same environment
on any Java-enabled OS.
- 9
- Java UML tutorialsThere's a good tutorial on UML with corresponding Java code at
http://www.parlezuml.co.uk/tutorials/java/class/index.htm
So far there's only one on class diagrams, but there's quite a few
much more advanced UML tutorials aimed at C# developers that this one
seems to be a "port" of, so expect more tutorials soon.
designman
- 10
- free java datetimepickerhi,
if you need a datetimepicker-control for java,
you can find one on my side:
http://www.software47.de/eng/software/datetimepicker/datetimepicker_en.htm
it's absolutely free, you can use it as you like.
since i was looking for a free datetimepicker myself, but found nothing, I
wrote one the last days...
If you find bugs or have ideas to better it up, let me know.
Java 1.4 is needed! (because of frame.setundecorated...)
kind regards wolfgang
- 11
- Tweaking DefaultTreeCellRendererHello,
I'm implementing Drag & Drop for my JTree and I got everything working so far.
There is only one thing that I'd like to add: I would like to highlight the node
that is the current drop target somehow. I did manage to select the node
during my dragEnter() and dragOver() events, but I'd rather not change the
tree's selection during dragging.
So I thought I could customize the TreeCellRenderer used. What I did is the
following:
I extended DefaultTreeCellRenderer and added a method to set the current drop
target row. When creating my tree I set the new renderer as the tree renderer
(which is working because I can see the methods beeing called when adding a
System.out.println())
The I overwrote getTreeCellRendererComponent(). Before calling the
super.getTreeCellRendererComponent() I check if a drop target row is set, and if
it is I pretend the cell is focused:
public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
{
boolean drawFocus = hasFocus;
if (this.dropTargetRow != -1 && row == this.dropTargetRow)
{
drawFocus = true;
}
return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf,
row, drawFocus);
}
But this does not work. I have added debuggin code and the dropTargetRow
variable is set and initialized correctly.
What am I missing here? When I pass a hardcoded true or false to the super call,
it does work (all nodes either always focused or never)
Thanks for any input
Thomas
- 12
- Help for Windows CEHi
I'm a student and I need to develope an application in java for
Windows CE.
Now I've installed on my pc Eclipse and a sun virtual machine for
windows XP.
My question is: What I can do in order to use my eclipse for develope
an application for my pocket pc with windows CE?
How I can do for make graphical applicationin windows CE? Under
Windows I use the VE plugin but under winCE what I can do for this
problem?
thank very much for all people who help me!
Fabrizio Dominici
- 13
- contributiscusate ho sbagliato mira
"Laura" <email***@***.com> ha scritto nel messaggio
news:cnMSg.126457$email***@***.com...
> ma un informatico con p.iva fa parte dei lavoratori autonomi a cui
> verranno aumentati del 2%
> o dei lavoratori atipici a cui saranno aumentati del 5%?
>
- 14
- Applet, use seperate classHi I am making a applet that uses a seperate class, but my IDE tells me
that when I try to use my seperate class, that it cannot resolve the
symbol (ie cant find it) ,or if I try to import the class, that it
expects a '.'. Here's the code
import java.awt.*;
public class Buiding
{
private int width, height, topBuffer, sideBuffer, widthOfWindow,
heightOfWindow,
heightOfThird;
public Buiding(int width, int height)
{
this.width = width; this.height = height;
topBuffer = height/20;
sideBuffer = width/20;
widthOfWindow = width/10;
heightOfWindow = height/10;
heightOfThird = height/3;
}
public void draw(int x, int y, Graphics page)
{
int origionalX = x, origionalY = y;
page.drawRect(x, y, width, height);
int randomXWidth = x - widthOfWindow;
int randomX = (int)(Math.random()*randomXWidth);
int randomYWidth = y + heightOfThird - 2*topBuffer -
heightOfWindow;
int randomY = (int)(Math.random()*randomYWidth);
randomX += x;
randomY += y;
page.fillRect(randomX,randomY,widthOfWindow,heightOfWindow);
}
}
import java.applet.Applet;
import java.awt.*;
import Building; //stops here
public class test extends Applet
{
private Building test; // or here if the above line is not there
public void init()
{
test = new Building(100,100);
}
public void paint(Graphics g)
{
test.draw(10,10,g);
}
}
Thanks for any help
- 15
|
|
|