zeroliken 79 Nearly a Posting Virtuoso

other than that you could use an overlayLayout
1) create a JPanel and set its layout to OverlayLayout
2) create a new JPanel and add the image to this then add this JPanel to the JPanel created in 1
3) create another JPanel and add your buttons here then add this JPanel to the JPanel created in 1
4) add the JPanel created in 1 to the JFrame.

zeroliken 79 Nearly a Posting Virtuoso

you need to decide wether to use file i/o in C or C++
for C++ read this: http://www.cplusplus.com/doc/tutorial/files/
for C read this: http://www.cprogramming.com/tutorial/cfileio.html

dij_0983 commented: helpful links +1
zeroliken 79 Nearly a Posting Virtuoso

if you mean you need help concerning a virus or something similar?

then yes if either crunchie or PhilliePhan or anyone else who can read logs from MalwareBytes is available today

zeroliken 79 Nearly a Posting Virtuoso

and after would be collision detection with the platforms when it detects the position of a platform it should stop the downward motion

a good example for this is a mario game
though deprecated here's a good example/tutorial I used as a base for my game a long time ago
http://www.javacooperation.gmxhome.de/PlatformGameBasicsEng.html

zeroliken 79 Nearly a Posting Virtuoso

You've been here for a long time already yet you still didn't put the code between

tags
the reasons WHY you should do this is that it preserves the indentation for easier reading and puts lines of code that help us point out a particular line to comment on

Did you compile the code??
>> if(strcmpi(str,"+")==0)
you have a syntax error here

now for your problem

every time i enter the OPERATOR (+) it will add and that operator display as '0' im having trouble in that operator i need to display it as blank >_< help me guys

display a space using printf(" "); instead of 0...
Though I think you did not ask what you intended to ask here
post what you need in detail here by showing us the desired output or maybe the statement/s involved here
be very detailed when you ask a question

also read the following articles from the links:
Things to avoid in C/C++
gets()
fflush(stdin)
system("pause")

dij_0983 commented: right +0
zeroliken 79 Nearly a Posting Virtuoso

The problem isn't the first letter of the string
your comparing the null terminator of both strings which is equal

@line 6 remove the +1 from strlen
@line 13 change the condition to count<length (compare only the last letter value)

zeroliken 79 Nearly a Posting Virtuoso

>>int min = total [0];

there's not gonna be a value less than 0
why don't you set min as the first value of the array after the array is filled

zeroliken 79 Nearly a Posting Virtuoso

the random() method from the Math class returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
try using one of the the Random class methods instead
Here's an example:
http://www.javapractices.com/topic/TopicAction.do?Id=62

EDIT: Just noticed that you solved it on your own, congrats :)

Valiantangel commented: Hey thats a good link.I will remember but for now i thik math.random() will do. +1
zeroliken 79 Nearly a Posting Virtuoso

you declared the function's data type as void in the function prototype yet you declared it as a char

zeroliken 79 Nearly a Posting Virtuoso

sum of 10 first terms series : -1 +2/3 -3/5 +4/7 -5/9 ...

you need to discuss how those terms will be computed in a detailed manner

So for now this is my interpretation of your problem for a possible solution
make a loop that will increments a integer variable by 1 and another variable that increments by the value of the first variable then do the operations you need
and finally convert the final result's to either a negative or positive value for every loop

zeroliken 79 Nearly a Posting Virtuoso

I have added an ActionListener but i want each button to have there own Action.

make a conditional for every array index to execute a specific action

Also what i wanted is to hide the contents in the button.

what contents would you want to hide?

zeroliken 79 Nearly a Posting Virtuoso

Try to iterate over the value of n in the second loop instead of i
then use an if else statement
if the value of j is less than or equal to i print only the value of j
else print a space(" ")

zeroliken 79 Nearly a Posting Virtuoso

I see now the problem

for (int i=1; i<=n; i++)
	{
		cout << "Please enter the value for x " << i << ": ";
		cin >> x[n];
		cout << "Please enter the value for y " << i << ": ";
		cin >> y[n];
	}

your accessing the wrong index that should be x and y

zeroliken 79 Nearly a Posting Virtuoso

How should I improve the code?

how about using the isdigit() or read the input as string then check it using strtol function
Here's a good example a found
http://stackoverflow.com/questions/3403632/check-if-user-input-a-float-to-a-int-var

zeroliken 79 Nearly a Posting Virtuoso

you need to assign every element one by one
try something like this:

//initialize dynamic array
double ** similarities;
int i, j;
      similarities = (double **) malloc (5 * sizeof(double*));
      //then check if it can't allocate enough memory
          for( i = 0; i<5 ; i++){
              *(similarities + i) = (double *) malloc (5 * sizeof(double));
              //*(similarities + i) can be similarities[i]
          }
for (i = 0; i<5; i++){
     for (j = 0; j<5; j++){
     similarities [i][j] = similarities_b [i][j]; //assign values
     //similarities[i][j] can be *(*(similarities + i) + j)
     }
}
zeroliken 79 Nearly a Posting Virtuoso

What exactly is the OS you're using? 7 or vista

Anyway Here's something I found from the Windows FAQ

A program or scheduled task might be waking your computer. By default, Power Option settings do not allow scheduled tasks to wake the computer from sleep or hibernate. However, some programs might awaken the computer if these settings have been changed.

To prevent programs from waking your computer

1. Open Power Options by clicking the Start button , clicking Control Panel, clicking System and Security, and then clicking Power Options.

2. On the Select a power plan page, click Change plan settings for the plan that you want to change.

3. On the Change settings for the plan page, click Change advanced power settings.

4. On the Advanced settings tab, expand Sleep, expand Allow wake timers, choose Disable for both when your computer is running on battery and when it's plugged in, and then click OK.

Ancient Dragon commented: Nice info :) +0
zeroliken 79 Nearly a Posting Virtuoso

your not reading the file word by word... judging from the current code, it will only check the first word of the files

use a loop that will get the words from the file until it reaches the EOF

PureHashIsh commented: Was very helpful and specific with the question at hand +0
zeroliken 79 Nearly a Posting Virtuoso

Other than the official oracle docs...
Did you check the read me thread at the top of this forum?
If you scroll down you'll see some tutorial links
http://www.daniweb.com/software-development/java/threads/99132

zeroliken 79 Nearly a Posting Virtuoso

I think I found your classmate with a similar problem
http://www.daniweb.com/software-development/c/threads/413992

see the suggestions given there

zeroliken 79 Nearly a Posting Virtuoso

got problem when i clicl the checkbox 0r radiobutton..when i compile there is no error

Could you tell us what happens after you clicked either?

..and also how can i put the background image at my gui??

Here's some links that might help
http://www.java2s.com/Code/Java/Swing-JFC/Panelwithbackgroundimage.htm
http://stackoverflow.com/questions/523767/how-to-set-background-image-in-java

zeroliken 79 Nearly a Posting Virtuoso

At the get input functions use the variables you passed on to those functions
assign values to the variables and return them
then at main, assign values to op1, op2 and opr using those functions like

op1 = getOp1(op1);

use cout statements after these to make sure you got the correct values

zeroliken 79 Nearly a Posting Virtuoso

It should be PNG Image (.png)
Try converting it to png image, there are lots of converters on the web

zeroliken 79 Nearly a Posting Virtuoso

I tried the program and got it to work...
Did you put the image in the same directory with the class files?
are you sure that the image has the right filename and extension?

zeroliken 79 Nearly a Posting Virtuoso

first use fgets()

then about the problem
scanf() is leaving a newline character in the stream for fgets()/gets() to read. either change how you're using scanf(), or use a different method of input.

Read this post:
http://www.daniweb.com/software-development/c/threads/412789/1761216#post1761216

Ancient Dragon commented: Correct :) +17
zeroliken 79 Nearly a Posting Virtuoso

but nothing is drawn.

the drawing should be done in the paint method, then try to use the values you have in the drawOneCircle method for the coordinates

here's an link for more info about this that might help
http://en.wikibooks.org/wiki/Java_Programming/Graphics/Drawing_shapes

zeroliken 79 Nearly a Posting Virtuoso

the setColor should be in the paint method

zeroliken 79 Nearly a Posting Virtuoso

It's a practice to always declare variables at the start of the program
Don't initialize the strings s and f inside an if statement
initialize them from the start and remove all the declarations in the if statements

Why can I not use a string created during an if/else statement

my guess is the compiler wouldn't find the symbols used in line 69 at compile time

zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso

in your previous code

public CircleComponent(Point2D.Double point)
   {
      circle = new Circle(200, 200, 100, Color.BLACK);
      final double SMALL_RADIUS = 3;
      Color color;
 
      if(Circle.isInside() == true)
         color = Color.GREEN;
      else
         color = Color.RED;
      smallCircle = new Circle(point.getX(), point.getY(), SMALL_RADIUS, color);
   }

@ line 7
Java is case sensitive that would be circle.isInside(/*argument*/) since circle is your new Circle object
plus yoou need an argument that has the same argument type for public boolean isInside(Point2D.Double p)

zeroliken 79 Nearly a Posting Virtuoso

Guys you could have just simply used the flag bad post button on the left side of the post to get a mod's attention to get this thread moved to the web development forum, there's no need to argue about this

dantinkakkar commented: You settled it out, but why give a -1 repo to a new guy who has no idea about this? +3
zeroliken 79 Nearly a Posting Virtuoso

I think we dream so we don't have to be apart so long. If we're in each others dreams, we can be together all the time.

- Hobbes (from the comic strip, Calvin and Hobbes)

zeroliken 79 Nearly a Posting Virtuoso

^yes we'd more than happy to help if you post it here where any member can see and give their help and suggestions

and please remember to wrap the code in code tags

zeroliken 79 Nearly a Posting Virtuoso

Once you use a character array you need to make specific changes in the program

for example:

scanf ("%i", &password[7])

will be changed to %s for the string input

By changing it to a char array you should be able to make the neccesary changes in the code to make it compatible but if you still need further help with this you could always post all the error messages and their corresponding lines where they're found

P.S. there's no need to downvote WaitP's post, he posted the first step for the solution :)

zeroliken 79 Nearly a Posting Virtuoso

Well I got it to work... try commenting out the while loop and it skips the fgets

#include<stdio.h>
int main(void){
	char name[30];
	int c,r;
	printf("Enter number");
	scanf("%d", &r);

	while ((c = getchar()) != '\n' && c != EOF);

	printf("Enter name");
	fgets(name,sizeof(name),stdin);
        return 0;
}
zeroliken 79 Nearly a Posting Virtuoso

Here's a link on a thread describing the concepts about 2d and 3d arrays
http://www.daniweb.com/software-development/cpp/threads/104403

zeroliken 79 Nearly a Posting Virtuoso

1.

int x = findFirstEmpty();

remove this you don't need to find an empty seat
2. use a loop to check the content of the array
3. use public void cause there's no need to return anything

zeroliken 79 Nearly a Posting Virtuoso
SchoolBus n1 = new SchoolBus();

Instantiate only once, like only at line 144 and removes other initializations like

n1 = new SchoolBus();

you need not to create a new object everytime and overwrite the contents

zeroliken 79 Nearly a Posting Virtuoso

"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbour. Catch the trade winds in your sails. Explore. Dream. Discover " -Mark Twain

...the minecraft ending quote

zeroliken 79 Nearly a Posting Virtuoso
if(i-1 % i == 0)
            {
                isprime[i] = false;
            }
            isprime[i] = true;

even if it ran through the if statement the value of isprime will still be changed to true, try using an else statement

zeroliken 79 Nearly a Posting Virtuoso

I think its python, its a bit easier to learn the language and write the code compared to Java and C++

zeroliken 79 Nearly a Posting Virtuoso

TaxDeduc method does return a value but you dont seem to properly call the method itself
instead in your main method the variable is assigned as a float
these links should help you
http://www.tutorialspoint.com/java/java_methods.htm
http://www.wikihow.com/Call-a-Method-in-Java

dij_0983 commented: nice links +2
zeroliken 79 Nearly a Posting Virtuoso
while (i >= 0)
			{
				if(i == 0)
				{
					list[i] = value;
				}
				else
				{
					list[i] = list[i-1];
					list[i] = value;
 
					i--;
				}
                         }

once i becomes 0 at this loop its value will remain 0 because it will always pass the if statement which doesn't change the value of i

zeroliken 79 Nearly a Posting Virtuoso

that user hasn't logged back on since July 15, 2010 so good luck getting a reply

zeroliken 79 Nearly a Posting Virtuoso

I am becoming annoyed at the amount of responses on this site saying (something along the lines of) "This thread is 5 years old, please leave it alone.".

I am more annoyed about the replies 5 year old threads get...
Because They're usually a question made by a newbie not checking the date it was posted
or a useless reply from a thread that is already answered, still lots of trolls lurking around the web
If that's the case I am more than happy to say to leave the thread alone :)

I'm not saying that all the responses are bad but they're rarely good

happygeek commented: agreed :) +0
zeroliken 79 Nearly a Posting Virtuoso

That is weird, no matter what compiler, IDE, OS I use I am able to change the button size


I tried the program at ubuntu 11.10 built in compiler(gedit/terminal), geany, windows 7 netbeans and eclipse... I have no idea anymore what advice to give :(

zeroliken 79 Nearly a Posting Virtuoso

you need to put the main method and all your methods inside your public class

private Container getContentPane() {
throw new UnsupportedOperationException("Not yet implemented");
}
}

the last bracket here ends your public class
and don't put ); after the end brackets

*next time wrap your code in code tags so we can just point out what line you got the error

zeroliken 79 Nearly a Posting Virtuoso

I want the "Add To File" button to be full length (across the GUI)

do you mean that you want to edit the button size?
if so you can use this to change the button size
ButtonName.setPreferredSize(new Dimension(buttonWidth, buttonHeight));

zeroliken 79 Nearly a Posting Virtuoso

at the function at Line 142 , the bracket after return 0; ends just the while loop resulting in main and other functions inside the function at said line

Xenix-Hero commented: This helped me a LOT! I missed that one when searching through. +0
zeroliken 79 Nearly a Posting Virtuoso

Well, I keep moving the code blocks around. It does not work.How do I change the gallon variable since all I can do is Input number. Gallon does not have a specific value that is assigned to it.

printf( "Enter gallon used (-1 to end): " );
  scanf( "%d", &gallon);

did you try putting these statements inside the loop....

With all the replies I think enough hint is given already :-/

DeanMSands3 commented: Thanks, ZeroLiken. +3