darkagn 315 Veteran Poster Featured Poster

Take a look at the Java API in the Applet class. You will also need to embed the applet in an HTML page, but it has been so long since I have done that I am not sure I can remember exactly what to do.

darkagn 315 Veteran Poster Featured Poster

Is there any explination to why the command prompt can view the java file but none of my web browser will view the .class file? (Web browsers tested: Internet Explorer, Safari, Google Crome, Firefox, Opera)

Yes, because the code you are trying to run is not an applet, it is just a script that prints to standard output. That's what all those lines that read System.out.println mean.

darkagn 315 Veteran Poster Featured Poster

The error in Step 2 is caused by the fact that the %JAVA_HOME%\bin directory has not been added to your PATH variable. See afzal_01's post about this. Step 3 failed only because Step 2 did also.

darkagn 315 Veteran Poster Featured Poster

Put all of your components that you want to group into a JPanel and set a border around it. Something like TitledBorder should suffice, although if you want to get really fancy try a CompoundBorder. Then you just add the JPanel to your JFrame where you want.

darkagn 315 Veteran Poster Featured Poster

Are you allowed to change the constructor signature in the second GUI? If so, probably the easiest way to achieve what you are after is to pass a reference for the original GUI in the second GUI's constructor and use that reference in the second GUI's addClick() method to callback to the original GUI.

For example, in the "original GUI":

ArrayList<data> info = new ArrayList<data>();

private void getData(){
pd = new GUIProcessData(this);

pd.pack();
pd.setLocationRelativeTo(null);
pd.setVisible(true);
}

public void addData(data someData)
{
 info.add(someData);
}

and in the second GUI:

OriginalGUI parent;

public GUIProcessData(OriginalGUI aParent)
{
 this.parent = aParent;
}

public void addButtonClicked()
{
  data someData = getCurrentData();
  parent.addData(someData);
}

public data getCurrentData()
{
  // method to retrieve the data settings in the second GUI
}

or something like that.

darkagn 315 Veteran Poster Featured Poster

Take a look at the Java API for the java.io package which you will need a solid understanding for to accomplish your task. The Java API can be found here. This tutorial will probably prove useful to you too.

darkagn 315 Veteran Poster Featured Poster

First of all, you need to call your file "filename.java" not filename.class. When you compile the java source file a class file will be created that you can run in a Command prompt or Unix Console (not a browser) by typing

java filename

Otherwise your code should work as expected.

darkagn 315 Veteran Poster Featured Poster

If you tell us what the compiler errors are we will try to give you hints as to how to fix it yourself. That way you will learn more than if we just go ahead and fix it for you (which would be cheating btw). In the end you would only be cheating yourself...

darkagn 315 Veteran Poster Featured Poster

Hi king000000 and welcome to DaniWeb :)

The play method should either:

Start playing a track if the player is not already playing;
OR
Do nothing if the player is already playing.

The stop method should either:

Stop playing the track if the player is playing;
OR
Do nothing if the player is not playing.

To do both of these methods (play and stop) you will need to maintain the state of the Player. This will involve a simple state machine - draw diagrams before you begin, it will be easier in the long run. You will need to play a Track when the state is playing and the GUI should probably display some way to inform the user that it is playing.

The setTrack method should:

Change the current track to the specified value - need another member variable for this.

These tips should give you something to go on. If you need more help, feel free to repost with another question. :)

darkagn 315 Veteran Poster Featured Poster

The KeyEvent class has constants for each of the F-keys. You can use a KeyAdapter to listen for a key press, although this is an abstract class so of course you will need to write your own extension. Check out the API on both of these classes for more details.

darkagn 315 Veteran Poster Featured Poster

Thanks Atli that is exactly what my problem is!

darkagn 315 Veteran Poster Featured Poster

Hi all,

I am trying to run a javascript function, RH_ShowHelp, that is stored in the file RoboHelp_CSH.js. The function itself should open a popup window containing our product's help system (written with Adobe RoboHelp) and the javascript file was supplied by Adobe as the standard call. I have managed to test the javascript in a straight HTML page which works, but I can't seem to be able to get this to work in PHP.

function callHelp( $helpURL )
{
	$language = "javascript";
	$src = "include/RoboHelp_CSH.js";
	echo "<script src=$src language=$language> RH_ShowHelp( 0, $helpURL, HH_HELP_CONTEXT, $currentId ) </script>";
}

Any ideas on where am I going wrong?

Thanks in advance,
darkagn

darkagn 315 Veteran Poster Featured Poster

When you say it's not working, are you getting an error message? Does the string "Came in" print? If the answer is no to both questions then there are no Room objects in your LinkedList. Try a call to roomList.size() to see how many are Room objects exist in your list.

If you are getting the string "Came in" printed, then the problem is that you are just writing r.toString() - you don't actually do anything with that call like print it. Try

System.out.println( r.toString() );

instead.

darkagn 315 Veteran Poster Featured Poster

Sorry manisha but I am out of ideas. Maybe someone else can help you?

darkagn 315 Veteran Poster Featured Poster

It might also be worthwhile pointing out that this code will only work on windows operating systems. Really you should probably have this in an if-statement to ensure running this code only in a windows environment. An else statement might allow you to open a different shell in Linux, Mac, other environments?

darkagn 315 Veteran Poster Featured Poster

Not sure if this will work, but the command for opening the cmd shell in a batch file is simply cmd. Maybe try changing the line

String command = "cmd.exe";

to simply

String command = "cmd";

and see what happens?

EDIT: Actually, if that doesn't work, try "start" instead of "cmd" as that is the command to open a new CMD shell from a running CMD shell.

darkagn 315 Veteran Poster Featured Poster

When you say it's not working, do you get an error message?

darkagn 315 Veteran Poster Featured Poster

Hi Shubhang and welcome to DaniWeb :)

I am sorry, but I don't understand what you are asking. Can you please post some code to show us what you mean?

darkagn 315 Veteran Poster Featured Poster

Ok, thanks for the advice. I think I will change tack and install Apache.

darkagn 315 Veteran Poster Featured Poster

Thank You for your advice. I will try. But the problem is that with PostgreSQL everything work well

Unfortunately different implementations of SQL can often have different ways of doing things. PostgreSQL is actually closer to PL/SQL and even MySQL than MSSQL in implementation. This means that portability of your queries is an issue. dickersonka has given you some sound advice for your MSSQL version.

darkagn 315 Veteran Poster Featured Poster

Hi peter_budo and thanks for the reply,

Most of the installation documentation that I have found seems to imply that IIS installs are tricky, but I was hoping to give it a try as my home PC already runs IIS. Was it just the install that was tricky for you, or was it also harder to maintain? What other advantages are there to running Apache than just the install?

darkagn 315 Veteran Poster Featured Poster

Hi all,

I wanted to ask if it is a good idea to install PHP on a windows XP machine running IIS? A lot of the documentation I have read talks about Windows 2000 Server with IIS, but not XP.

At work I run PHP on a Linux-like platform (FreeBSD to be precise) but I have never installed it in a Windows environment before. Is there any major differences between versions that I should be aware of?

Any advice would be most welcome and appreciated. :)

Cheers,
darkagn

darkagn 315 Veteran Poster Featured Poster

What errors do you get when you try to run the queries?

darkagn 315 Veteran Poster Featured Poster

Where in the class myFinalToolkit is the computeColorSampleImage(BufferedImage, int, int) method? I can't see it in the code that you posted, but that could be because you didn't use code tags :P

darkagn 315 Veteran Poster Featured Poster

So your permissions on that folder are not correct. Can you type

ls -l -a

in your Cygwin window and check the permissions of your folder? It's the part that looks like

rwxr--r--

The permissions relate to your permission, your group's permission and other permissions. If you are trying to run the find command from a program, you will need the 'other' permissions to be set to at least read, if not read write execute. To change the permission, use the chmod command.

darkagn 315 Veteran Poster Featured Poster

I think what you need is to have some way of refreshing the lists according to user selection. This should be achievable using a Javascript function call when the user makes a selection. I'm not sure how to do this exactly, maybe ask your question in the Javascript forum?

darkagn 315 Veteran Poster Featured Poster

You need to backup the database and then the .bak file that is created can be restored on another PC quite easily. Are you using SQL Management Studio?

darkagn 315 Veteran Poster Featured Poster

I'm not 100% sure, but I think you need to

import one.two.*;

to import the two subpackage where the Show class resides.

darkagn 315 Veteran Poster Featured Poster

In fact you don't need to, but it would probably read better if you got rid of the 'vehicles'. You don't need to explicitly specify the table for the sort operation because you are only getting your data from a single table. If you were using a join or otherwise accessing more than one table, then it is necessary to specify the table.

HazardTW is incorrect, a comma will make your SQL invalid. I think he/she thought that you were trying to sort by more than one column, rather than by a column in the specified 'vehicles' table.

darkagn 315 Veteran Poster Featured Poster

So a Stack is just a data structure that follows the Last In First Out rule (LIFO). This means that the last item placed on the stack (with an add or push method of some description) will be the next to be removed (by a call to a remove or pop method).

The Java API provides a basic Stack class that you can use (in the java.util package).

darkagn 315 Veteran Poster Featured Poster

Hi paucki and welcome to DaniWeb,

I am sure that all of us here at DW would be happy to try to help you with any problems that you encounter. That is the whole point of DaniWeb! Just post a description of your problem, as well as any relevant code to show your attempts, and we will try to help.

Sounds like an interesting project, good luck :)

darkagn 315 Veteran Poster Featured Poster

Couldn't you just have a status field in your message object? This could be used to determine whether a message has been read, unread, deleted, caught by spam filter etc.

darkagn 315 Veteran Poster Featured Poster

Start by setting $sort to some default value, say 0, before you try to retrieve it from the $_GET array. Then immediately before your while loop, you could do something like:

if ($sort != 0)
{
  $result = $orderresult;
}
darkagn 315 Veteran Poster Featured Poster

Hi jadamus and welcome to DaniWeb,

Ah yes, good old IE. Unfortunately, IE is notorious for doing things differently to other browsers. Can you please post your menu code for us to look at to see if we can offer any hints?

darkagn 315 Veteran Poster Featured Poster

You are probably better off having a single table in your database that just contains the votes of each user on each item being rated. This way you can ensure that each voter can only vote once for something. In order to calculate the total score, number of votes and average rating, you can do this:

SELECT SUM(Votes), COUNT(Votes), AVG(Votes) FROM UserVotes
WHERE Item = Whatever

or something similar...

darkagn 315 Veteran Poster Featured Poster

After you have created your eventStudent table can you DESCRIBE it?

DESCRIBE eventStudent;

If not, then the table has not been created. Like I said, you need to run your SQL file before trying to run your php script.

darkagn 315 Veteran Poster Featured Poster

First, make sure that the SQL file has statements that read like this:

CREATE TABLE IF NOT EXISTS Example
-- table definition goes here

Then you actually need to run the mysql query by typing the following into a terminal:

mysql DB_Name < script.sql
buddylee17 commented: You solved this post. +2
darkagn 315 Veteran Poster Featured Poster

You need to escape all of your double quotes with the backslash character. There are a few on line 100 that are not escaped. This is causing the error on line 101. It might pay to double-check your other lines too...

darkagn 315 Veteran Poster Featured Poster

Also, there is another problem that I can see with where you call for the next value of x, but I will let you try to figure that one out...

darkagn 315 Veteran Poster Featured Poster
System.out.print("Please enter an integer or (Exit) to stop:");
     x=keyboard.nextInt();
     for ( count = 0; count>=x; count++)
     {
       System.out.print("*" + count );

       x=keyboard.nextInt();      
     }

Your for-loop is wrong. You are saying "start at count = 0 and while count >= x, do the following code and add one to count". Now, either count will not be greater than or equal to x at first (if x is greater than 0) or if it is it will ALWAYS be greater than or equal to x (if x is 0 or less).

darkagn 315 Veteran Poster Featured Poster

You need to write a toString() method for your TimerAT object that converts an instance to a String representation. Then you can just loop over the array and print each one using a call to

System.out.println( time[index].toString() );
darkagn 315 Veteran Poster Featured Poster

What compiler errors are you getting?

darkagn 315 Veteran Poster Featured Poster

Hi threebluldboys and welcome to DaniWeb :)

The line

return mysql_query($query);

comes before you have defined what $query is. It should probably come at the end of the function as it is returning something.

Hope this helps and happy php'ing!

darkagn 315 Veteran Poster Featured Poster

Check out the Java API for documentation on the KeyListener interface. This interface provides the necessary tools for listening for key presses. Depending on what you are trying to do though, it might be better to interrupt rather than listen for the key press.

darkagn 315 Veteran Poster Featured Poster

Why do you need your inner class to be static?

darkagn 315 Veteran Poster Featured Poster

Hi nanna and welcome to DaniWeb :)

You have a line that reads

do {

If you remove that line I think this will solve your problem. Incidentally, a do-statement needs a condition at the end of it to let java know how long you want to do something for. Syntax should be:

do {
  // whatever it is you want to do
} while ( something == true )

But I don't think your do-statement is necessary for what you are trying to do, so just remove it.

Let us know if you have any other compiler errors and we will try to help.

darkagn 315 Veteran Poster Featured Poster

The way I see it is you need two groups of tables in your database, one for the seating and the other to record bookings. Your seating tables would be tables like Seat and SeatType that record the details of each seat in the venue, while the booking tables would be Customer, Booking, BookingDetails and maybe even CustomerType. Here is what I was thinking:

TABLE Seat
SeatID int,
Row varchar(2),
SeatNumber smallint,
SeatTypeID int

TABLE SeatType
SeatTypeID int,
SeatType varchar(20),
BaseCost smallmoney

TABLE Customer
CustomerID int,
CustomerTypeID int,
FirstName varchar(15),
Surname varchar(15),
TelephoneNumber varchar(20),
CellPhoneNumber varchar(20),
Email varchar(50),
AddressLine1 varchar(30),
AddressLine2 varchar(30),
Suburb varchar(20),
State varchar(5),
ZipCode varchar(10)

TABLE Booking
BookingID int,
NumberSeats smallint,
TotalCost smallmoney,
BookingTime smalldatetime,
Paid boolean

TABLE BookingDetails
BookingID int,
CustomerID int,
SeatID int,
EventTime smalldatetime

TABLE CustomerType
CustomerTypeID int,
CustomerType varchar(20),
DiscountApplicable boolean,
DiscountPercentage decimal(2, 4),
DiscountAmount smallmoney

Anyways, that's a start...

darkagn 315 Veteran Poster Featured Poster

postfix = postfix + " " + (Integer.parseInt
(symbol));

This line is attempting to change the entire string to a number, not just the number part of the string. The string "4+4" is not a number, even though the charAt(0) is a digit...

darkagn 315 Veteran Poster Featured Poster

Q1:

The System.exit() method terminates the Java Virtual Machine, not just a single frame.

Q2:

Not sure what you mean by this Question.

darkagn 315 Veteran Poster Featured Poster

Why do you want to do this? Are you trying to hack a website for some nefarious purpose?