286 Posted Topics
I have this code which should resize the image in the header. [CODE] #headerWrap { margin-left: auto; margin-right: auto; margin-bottom: 0; width: 90%; height: 7%; background: url('Images/header.gif') no-repeat; } img.image { width: 100%; height: 7%; } [/CODE] and this is the html code to go with it [CODE] <div id="headerWrap" … | |
I have made this screenshot program in hopes of eventually making a screen recorder, but I am having trouble displaying the image for the user to see. I currently have it so that it displays and saves. When it displays it is blank, but when it saves there is a … | |
Re: What type of code? Are you making it online (applet), or a launch-able application? Edit: by what type I mean game or website enhancing program, or a database like code | |
I made a simple menu using css and a tutorial on youtube and now I would like to change px into percentages. I have managed to do most of it, but when I go to products, insted of them being listed under each other 4 of them are beside eachother … | |
I am making a game where random obstacles appear. The obstacles will move towards you. I currently have this code to animate the obstacles. [CODE] for (int i = 0; i < obstacle.size(); i++){ // animate walls obstacle.elementAt(i).x -= 1; } [/CODE] My vector multiple instances of the Walls class … | |
Re: 5 vectors could solve this problem (though there probably is a more efficient way). Make one for the start x and one for the start y. Repeat for the end positions. make one for the color use an advanced for loop to set the color and then print the lines … | |
Re: According to this your image does not exist. Make sure you have the correct directory, and the image name is correctly typed (including the extension). | |
Re: Use a for loop to set up the buttons, and then use the index of the button in the array for the separate commands. button[0]{} button[1]{} etc. | |
Re: Is there any ide that could be used to make Java files for Android? It would be nice if you could test it out using the ide, if not then if there would be an Android emulator it would also be nice. | |
I would like to display 3 images in a row, and then 3 more underneath, and so on (until there are no more images). I currently have this css code [CODE] #productsMenuFirst{ display:inline; width: 100px; height: 60px; padding-right: 50px; padding-left: 50px; } #productsMenu { display:inline; width: 100px; height: 60px; padding-right: … | |
I have this code that should set up the page header [CODE] #headerWrap { margin-left: auto; margin-right: auto; width: 700px; height: 100px; background: url(Images/header.gif) no-repeat; }[/CODE] the picture is not being displayed. Please tell me how to fix this. Thanks | |
Re: If you are worried about them typing their answer in with crazy caps in the middle of the word, then use the equalsIgnoreCase(); | |
Re: you will need to use some other operators the ==. Google Java operators | |
Re: you could get the characters from the string (that you get from the input) and use a loop to get all the characters in the loop you want to see if there is a space. if there is then you would signal that that is one word, then you would … | |
Re: After I fix the spelling errors it runs fine for me. I don't get any errors. Next time please use the code tags Your code with fixed cases: [CODE] import javax.swing.JOptionPane; public class Bmi { public static void main(String[] args) { //declare variables int height; int weight; String accept; double … | |
I am creating a program that will simulate a fish tank (got it off of google) and when I try to get the image using [CODE]mClownImage = getToolkit().getImage("Fishes/mClown.gif");[/CODE] the getToolkit() part gives me an error. it suggests that I make a method called that. I have imported java.awt.Container; which contains … | |
Re: You could also use a different method to read it look at [URL="http://download.oracle.com/javase/1.3/docs/api/java/io/BufferedReader.html"]this[/URL] | |
Re: I have heard that they revised the audio player for Java. Does that mean that Java can now play .mp3 and .wma files, not just .wav? Or did they just implement a new way to add audio? | |
Re: or you could make a new JFrame that displays the information the user entered and then after they click the "confirm" or the "OK" button then use the dispose (); method to get rid of the frame [CODE] confirmationFrame.dispose (); [/CODE] | |
Re: A combination of this forum, a couple of books (I use [URL="http://www.amazon.com/Sams-Teach-Yourself-Java-Days/dp/0672329433"]Sams Teach yourself Java in 21 Days[/URL] as my reference (don't think you can actually teach yourself Java in 21 days)), and youtube tutorials, like [URL="http://www.youtube.com/watch?v=Hl-zzrqQoSE"]TheNewBostons[/URL] Java tutorials will suit you well when learning java. | |
Re: [QUOTE]first of all how do you know it is his homework?[/QUOTE] If it wasn't homework and he was stuck without code, he would then go and learn/make a program that is simpler then the one he is currently trying to make. He would do this so that he could learn … | |
I am working on a snake game. I have posted about it before. It is going well, and now I would like to implement a high score option, that saves the score online, so that everyone can see it. I am planning to make a menu, that will have a … | |
I would like to learn PHP and I am wondering how to install it. I am planning on using the Eclipse PHP IDE for coding. I have tried a couple of installs for PHP and I could not get any of them to work. I have a vista ^$ bit … | |
Re: you can use the startsWith(); method, which checks if the word starts with the letters entered. for example [CODE] private String[] auto = {"lorem", "ipsum", "dolor", "sunglasses", "friend", "time", "flies", "like", "an", "arrow", "daisy", "bell", "the", "quick", "brown", "fox", "jumps", "over", "lazy", "yellow", "dog"}; public static void main (String [] … | |
Re: you dont use the jar file. Just copy the class files into your storage area for your website and then navigate to it. Like so [CODE] <html> <head> <title> The ArrowKeys2menuprob2 applet </title> </head> <body> <h2> Here is the YourAppletName applet </h2> <hr> <applet code="RectanglesMover.class" width="500" height="500"> </applet> <hr> </body> … | |
I have this snake game I keep talking about and I added in a menu. now when I run the snake game the first time it works. When I press T to return to the title, it returns. When I click on the colored snake game after that the snake … | |
I am trying to make a snake program The code I currently have looks like this [CODE] import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.*; public class SnakeG extends JPanel implements KeyListener, Runnable{ private Vector<Point> snake = new Vector<Point> (5,2); private Vector<Rectangle> snakeRectangle = new Vector<Rectangle> (5,2); public void startGraphics … | |
I am trying to make a snake game and I am wondering how I could get an element of an vector and then use the number for the y coordinate like when using ararys lets say the x element I am using is 3 then I could type in arrayY[3] … | |
I am making a simple game and I cant seem to get the line to center. I would like it all to be in a column and centered. I have this line of code that is not centering [CODE] JLabel numberOfChangesLabel = new JLabel("" + totalChanges); pane.add (new JPanel ().add(numberOfChangesLabel)); … | |
Re: [QUOTE]Sorry sir I didn`t understand you about making string inside the listener,, I want to change an integer..!![/QUOTE] Yes, yo do want to display an integer, but you want to make it a string [CODE] String displayText = "" + number; [/CODE] and then you want to set that to … | |
Re: you could put a boolean variable in for the condition and then set it to false when you want the delay, then start a timer that generates every 2 seconds, then you want to stop the timer set the variable to true and then call your loop again. You would … | |
Re: Get the input and then separate it to characters. then compare them to print out a text. Without your code I can offer no further help. | |
Re: make a graph calculator. use graphics and then get the user to type in a valid expression. then calculate the y points for the x values and graph it. This will let yo use graphics and arrays. You will also use Math class. It will be interesting especially if you … | |
I am attempting to make a chatroom as my first program that communicates between computers. I am having trouble setting up the Server Socket Though. My program stops when it tries to set up. Here are my variables [CODE] private JTextField textArea; private ServerSocket servSock; private Socket sock; private BufferedReader … | |
Re: If you already know C/C++ then I'm sure you could understand TheNewBoston's tutorials on Java. Just youtube him. He rushes though basic concepts (That you should already know). Just try to learn from him. You can always come on this forum to ask questions if you need extra help :) | |
Re: I have Sams Teach Yourself Java 6 in 21 days, but I just use it as a quick reference,but I'm sure you can use it to learn. It may be difficult, and it definitely wont take you 21 days to learn, but you will learn it eventually. | |
During the 3 years I have had my laptop, I found a weird glitch in the Vista OS. Sometimes when I shut down my computer the screen goes blank, and I cannot wake it up. I assume the Vista OS had shut down, but it didn't shut down the computer. … | |
I am not sure where this would go, because I did not find a CD/DVD drive section. I have a laptop (Toshiba) and my DVD drive stopped working. I believe it stopped working a while back, when my windows core files were dumped, and when I used the system recovery … | |
Re: you could store the day in a file and then when you run the program it checks todays date and compares it with the date in the file. if they are different then it starts a new set, however if they are the same then you read off the last … | |
Re: put this line in for your text [CODE] new JButton ("<html><CENTER><font size=\"3\">+/-</font></CENTER></html>") [/CODE] set the size of the button with the [CODE] JButton.setPreferredSize (new Dimension (sizeX,sizeY)); // these are in px [/CODE] I needed to use these for my calculator (lol) | |
Re: if you want to get out of the if statement just use the break; command. It will get out of the nearest set of braces | |
Re: It is because you set check to true. [CODE] boolean check = false; for (int i = 1; i<=numplayer;i++){ while (check == false){ System.out.print(playerarray[i-1] + ", what number do you think it would be :"); Scanner num = new Scanner(System.in); String checkifint = num.next(); try { int guess = Integer.parseInt(checkifint); … | |
Re: [QUOTE=AhmedGhazey;1598100]i tried it before it works fine , try it and tell me . SHUTDOWN -S TO RESTART SHUTDOWN -R TO ABORT SHUTDOWN -A I hope this help. :)[/QUOTE] He is trying to [B]turn on[/B] a computer not turn off. An idea, but it is not with programming. Just make … | |
I am going to make a calculator and I am having some Issues arranging the buttons. You should be able to see the layout when you run the code. Some clarification though there will be a blank spot under the "3" for a "+/-" button (switches between positive and negative). … | |
I am learning C++ and I learned that you can create your own types. I decided to try this in java. I am wondering if there is an easier way to make a bunch of variables private other then typing out private for each of the created variables. for example … | |
Re: jpanel.setText ("Text Here"); You [B]may[/B] need to revalidate. | |
I have a toshiba laptop running XP and the internet was working until a while back, but then it stopped. I have a Vista on the same internet and it works on it. What could be the problem we have a DLink router. I have tried many things that I … | |
Re: Mine has a same type of error. When I start it up in the normal power setting it turns the fan for like a second then turns off, when I put it to a higher setting the comp turns on, but there is not video out, so I don't know … |
The End.