No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Seem to be having trouble. The trouble i'm having is the calculateAverage, and a bit of the public static main void area. I'll explain: calculateAverage: What i'm suppose to do is read from the txt file. I tried doing the inFile.nextDouble part, but seem to be getting errors. i'm not … |
|
I just added a pause button to my game, using most of this code: [URL="http://msdn.microsoft.com/en-us/library/bb195026%28v=xnagamestudio.31%29.aspx"]http://msdn.microsoft.com/en-us/library/bb195026%28v=xnagamestudio.31%29.aspx[/URL] For some reason it changes the Window.Title to "[GameName] - Paused" and even though it's unpaused it still says paused in the title. I never told it to change the title so I guess it … |
|
Using a Single-Array, create a program that asks the user to input a day of the week, the high temperature, and the low temperature. Calculate the Average High and Low. |
|
I have a web project I've been working on in my free time using mostly jsp. It's currently set up so that if a user clicks the login button it takes them to a check-login servlet which will return whether it's a valid login or not through a session.setAttribute("loginstatus","Valid"). Everytime … |
|
I made a basic JUnit test to set up this oracle database on my computer with hibernate. The database works and everything, but trying to hook it up to Hibernate is proving to be a challenge. My config file is below: [code] <hibernate-configuration> <session-factory> <!-- Database Connection Properties --> <property … |
|
I have installed JDK 7. Is it possible to write code in JDK without Netbean IDE ? |
|
I'm not sure how it's done, but I need a link to change an attribute so that the main content page can get the attribute and then display the appropriate content. My following code does not work...and it always seems to include home.jsp no matter what (home is set from … |
|
I'm completely new to JSP but not Java [CODE]<div> <%@ page import="java.util.*" %> <%= Date date = new Date(); out.println(date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); %> </div>[/CODE] All I need is [CODE]Hour:Minute:Second[/CODE]. (Edit: stupid emoticons) I'm getting this error on Date [CODE]Multiple annotations found at this line: - Syntax error, insert ")" to complete MethodInvocation … |
|
Alright, well I've already taken Java programming at Auburn University for my first programming class. I'm taking C programming this coming semester. I've been learning C all summer, and now I would like to try making simple games! I have DEV C++ as my compiler, but I'm not sure where … |
|
I keep getting the IndexOutOfRangeException for my XNA game and after printing the indexes it stops at 600. Is that the max limit for arrays in C#? I'm trying to get all of the pixels from an 800x600 image into an array so I can test when a R:20 G:20 … |
|
I have 2 classes. One get/set BlockData, and one main class that loads,draws,updates. I have a big list of public Texture2D types that I have in the main class. I need blockdata to be able to get the texture2d types for each block and send it back to main...but blockdata … |
|
I just started teaching myself some basic things with this, but the simplest shit like strings seems impossible. Does anyone know any good sources, tutorials, or anything that might help me more? As an example...I wrote this code to tell when a control button was pressed: [CODE]//ProcessKeys int key; string … |
|
I'm making a game in XNA. I need a player to move from block to block (40x40pixels) and I need to be able to set the speed that the player is able to move at. Right now, I have this code: Update Method - updates 60 frames per second or … |
|
I'm creating a game with XNA, and having issues with Vector2 arrays. The code below will loop through each square on the grid for the game 40x40pixels. The first for loop getting the X coordinate and the second getting the Y coordinate. I'm getting the proper width and height (if … |
|
My homework assignment is to do the following steps below. I am able to write steps 1,2,3, and 5. I am stuck on how to go about writing code for step 4. Can I include this step into one of my for loops or do I need to write another … |
|
I have a simple text file that I am reading the contents of in a GUI. It's a simple program that enables a user to browse the file and add to it if needed. I have this part running fine, but I'm having some difficulty reading just the first word … |
|
So, I created some code in a jpanel. Is it possible to display just this panel or do I need to put it into a form. Either way, how would I go about doing it? |
|
I'm trying to display some text in a JTextArea I have set up in a simple GUI. Easy right? That's what I thought, but I'm clearly not that advanced at Java. The hook is the information I want to display in the JTextArea is in a text file (file.txt). Right … |
|
My friend and I are in a computer science class, and we were wondering how to edit the contents of a jar file? What software would we use, lines of code we might need, or any other input would be greatly appreciated. -From our computer to yours'- zach&kody |
|
When I run my program, sometimes it shows up and sometimes it just shows a blank frame. Is this because it's having trouble loading the canvas/buttons and all that stuff...aka do I need a loading screen and how do I do one in java? |
|
I have my code set up so I can 1)select what image and 2)the coordinates of the mouse click where the image is going to be placed. What it currently does it place the right image in the right coordiantes but if I click again somewhere else, it replaces the … |
|
I am wondering if I could write this code to a file and then print it at a starting location (like an image). [CODE] g.setColor(Color.white); g.fill3DRect(en1X + 0 * enZ, en1Y - 25 * enZ, 5 * enZ, 5 * enZ, true); g.fill3DRect(en1X + 5 * enZ, en1Y - 30 … |
|
Hi all, I'm trying to get the information from a text file to show up in the JTextArea I have in a GUI. I'm using the GUI editor in NetBeans, because I'm a Java newb. I've been reading a lot of things on the web and can't seem to figure … |
|
Is there a way to diplay a web page like google in an application in a JLabel for example. Kind of like the new minecraft launcher where it shows the update in a window about the login area. Thanks for any help. |
|
[CODE]PointerInfo a = MouseInfo.getPointerInfo(); Point b = a.getLocation(); int x = (int) b.getX(); int y = (int) b.getY(); System.out.print("Y: "+y); System.out.print("X: "+x+"\n");[/CODE] Right now I'm using this, but it gives me the coordinates relative to the entire monitor. Since you can move the program frame anywhere on the monitor, this … |
|
i have a file that contains hexadecimal values and i want to convert them to int how do u do that exactly?? [CODE] import java.util.Scanner; import java.io.File; import java.io.IOException; public class CacheSimulation { public static void main(String args[]) throws IOException { int hexAdd [] = new int [32]; //array to … |
|
This is my first time trying to use KeyListener and I just need it to move an image over 20 px every time I press the right arrow key. After 400px, it should move down to the next line vertically 'playery.' For Some reason it prints out the console output … |
|
Hi, i wanted to create a JTextField to receive the user input instead of having the user key in the input through the IDE console. This is my code. Now, my code just runs fine if the user key in the inputs through the console. After running the code, the … |
|