104 Posted Topics
Re: If I'm understanding your question, you want to know how to pass ArrayLists as arguments to methods, right? It's the same as any other arg. [code] public void func(ArrayList<Double> arrayList){}[/code] | |
Re: Cool program, but I think it should be distributed in a .zip file. More people can open .zip than .rar, even if .rar has better compression... Just a little thing I noticed. | |
Before I say anything else, I do realize that there are numerous threads on this topic, but I haven't been able to fix my problem. Okay. Well, here's my problem. I'm writing a map editor for the game that I'm working on, and the map is oftentimes much larger than … | |
Re: ? You only have one recipe entered. It won't change because there's nothing to change it to! Code in another recipe, with a different rating, and try then. | |
Hello. I have an undecorated JFrame (Which is rather boring by itself), and I would like to know how to get a drop shadow effect for it. I have researched it, but I haven't found anything, anyone have any ideas? Thanks in advance!!! | |
Re: in the 2 later methods, you have to supply the full path. you have to get the string version of the URL returned by getCodeBase(), and tack it onto the front of the image file name. I think that should work, I don't know much about the URL class.... | |
What I have is this: [CODE=Java] public abstract class Ability { public class Action extends Ability{} public class Reaction extends Ability{} public class Support extends Ability{} } [/CODE] I have it like that so I don't have all of the Ability-extended classes in their own .java file (to save room … | |
Re: I usually use the Toolkit.getDefaultToolkit().getImage(/*Path*/); method, which returns an Image object. [code=Java] Image img = Toolkit.getDefaultToolkit().getImage(/*Path*/); [/code] also, you might want to read this: [url]http://www.javaworld.com/javaworld/javaqa/2003-07/01-qa-0711-classsrc.html?page=2[/url] | |
Re: Make sure you describe what your methods and classes do and how they work, along with what variables they use (This goes along with creating a Javadoc for your program), ESPECIALLY if it is going to be open source. Doing that during the coding process will save TONS of time … | |
Re: Hi! Welcome to DaniWeb! When Posting code please wrap the code in [CODE="Java"] tags so it's easier for people to read ^_^ As for your question, you can't declare a public class inside another class. public means that the class can be accessed by any class. Inner classes can not, … | |
Hi. I have some data that I need to store in a file, and (for simplicity's sake) I was considering using bitwise operators to pack it all into a single hex or dec number. I've never user bitwise operators, as they really confuse me. If anyone has any pointers and … | |
Re: in the JTabbedPane class there is a method setSelectedIndex(int index). where 0 is the first tab, 1 is the second, ect. (I believe that is how it works, you can also select the tab with the method, setSelectedComponent(Component c). where c is the component that the tab represents. Hope this … | |
Re: hahaha, that's tricky, it took me a bit XD | |
Hi. I have a Vector of Vectors that I need to rotate 90 degrees clockwise and 90 degrees counter-clockwise. I got it to rotate Clockwise, but whatever I try, I can't get it to rotate counter clock-wise. The 2D Vector is not always going to be a square. It will … | |
Hi. In my attempts to create an email client, netbean's GUI builder has made me very unhappy... so, I decided I'd rather code it by hand... not my best idea, but whatever. Now, I'm trying to nest a Vertical JSplitPane in a Horizontal JSplitPane, and I can't see the left … | |
Hi. When I add a JComponent to my JFrame, it isn't the size of the remaining space in the frame. I want it to work in a way so that when i add a JComponent, it (and it's contents) stretches to fill the remaining space in the screen... Is there … | |
Re: Are you using the Sun version of Java? Because I'm pretty sure that there are over versions floating around (for whatever reason). Also, what Version number are you using? I believe 1.6.0_14 is the latest JDK version.... also, The error means that (for whatever reason...) you need the following line … | |
Hi. I started looking into JavaMail today, and I got the basics down. But when I sent a message to my friends Gmail account, it said that the message my not be from me, and was sent to spam... does anyone know why? | |
I'm writing an Email Client, and I need a JSplitPane that splits 4 or 5 JPanels instead of 2. I looked around and didn't really see anything that looked like what I need. I need it so I can adjust the size that is allotted to the subject, sender, date, … | |
Re: write a program that calculates the time it takes to fly from planet to planet however many times, using speeds that are currently available to NASA's space shuttles. Then, write a program that proves that Pluto IS a planet ;) Or, write a program that edits and makes its source … | |
Hi. I'm trying to write a program that, when ran, opens an undecorated JFrame, and shows a list of icons that when clicked on, run a program, or open a folder. I'm having trouble getting the actual Icon Image. When I try, it gives me one of the default Java … | |
Hi, I have another question. This one is about header files. I have a header for a player and the opponent of my battleship game. They way I have it set up, the opponent needs a player object to make a move, and vise versa. This is what i have. … | |
Hi, I'm new to C++, I learned to program in Java first. I'm having trouble getting this to work. I'm writing a text based version of battleship. It was going well until i tried to set the size of the ship. I'm using an int array to check to see … | |
Hi, I'm kind of new to the world of streams in Java, and I was wondering - I have this Server/Client program, and I need to read Objects and Text streams. I tried making an ObjectInputStream, and a PrintWriter out of the Socket's InputStream, but when I tried to read … | |
Hi, I was wondering it was possible to write a program that runs from the System Tray in Windows XP. For example, AVG runs all the time, but is on the System trey, so you don't worry about it until you need it. I was wondering if it's possible to … | |
Re: A) Please use code tags (CODE=Java), in place of (CODE). B) That wasn't much of a question, but it seems like your problem is that it doesn't recursively draw the triangles, right? Well, I ran it on my computer, and realized that 'i' was never being reset after drawing the … | |
What are beans? I've seen references to them, but when looking up an explanation, I always get lost and confused..... | |
Re: I suggest taking a look at the InputEvent methods that are inherited by the KeyEvent class. One of them is "isControlDown()" look at that one. =) | |
Hi. I have a predicament... I'm trying to make a JComponent that looks like this: _____________________ | | |Option Name [Text Field] | |____________________| It's for a Option screen that I asked about earlier (I got that part working fine). But now, I need a component that has the option … | |
Re: Umm, isn't that the point of the game? Moving up is technically considered colliding with itself. So, it's doing what it should. If you want it to do nothing when trying to move backwards into itself (like in the example you provided), put an if statement in saying, if you … | |
Hi, I'm trying to make an Options screen for the game that I'm writing. I know how I want it to look, but I don't know how to add Tabs, or move the buttons that control the options around... Below is a link to a picture of what i want … | |
Re: Arrays - [URL="http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter03/arrays.html"]Here[/URL] ArrayLists - [URL="http://www.bestjavainterviewquestions.com/arraylist-class/"]Here[/URL] | |
What is javascript? I've heard of it, but never looked into it. what can it do? | |
Re: To me, it looks as if the file you are trying to read from is set up differently than what you have coded to read it. the nextInt() method (if im not mistaken) checks the next position in the file, after what it has currently read. If the next group … | |
I don't know where this question came from, but... Is there a way to start at one directory, say... C:\ . and I wanted to go into that folder, and printout a list of the folders/files in that directory, and then do the same for the rest of the folders … | |
Re: What if when you resize the JFrame, you pass the JTabbedPane the width and height through the [code]resize(int width, int height)[/code] method while resizing the JFrame? | |
Re: If each book needs each of those variables, you need to do sometihg like, String ISBN = "<ISBN code>", and ect for each variable, and have a public String getISBN() { return ISBN; } and do the same for each variable that each class needs | |
Hi, I'm attempting to program a fire emblem/final fantasy tactics sort of game. I'm having trouble getting the movement range to layout correctly. The way I'm doing it works, but most of the time gets stuck in an infinite loop, and doesn't always show all of the possible movement/attack locations. … | |
Re: you could check the number of characters in the string, break it up into sections using a String ArrayList, and insert a \n after each string portion | |
I wrote a level-editor for a game that I wrote, and I need to save the image on the screen to a file so i don't draw a bunch of tiles to the screen each frame. I have no idea how to save it. I could just screenshot it and … | |
Hi, I was wondering is anyone could help me out. I'm trying to program Mario as my final for my comp sci. class. I'm not working about the actual Sprites now, just the basics, ie, moving, jumping and collisions. I'm stumped on the jumping part. Is there a good way … | |
Re: on a seperate, but still related note, you are importing the Scanner class, so you might as well use it =] You can use the scanner class to find the integers/doubles in each line. it would look something like this: [CODE=JAVA] Scanner line = new Scanner(inputFile.readLine()); // Make a Scanner … | |
Re: if you messed with it enough, the modulus would work... but... it's a hassle, and breaking the String apart using the Scanner class is easier, in my opinion. If you create a Scanner that reads the specific String, you can add a delimiter to the scanner, and go through each … ![]() | |
Hi, I'm trying to program Tetris. The thing is, I can't seem to get the Keylistener to work in the JApplet, and I have no idea why :( Here's my code: [CODE=java] import java.util.Random; import java.awt.event.*; import java.awt.*; import javax.swing.*; /** * Class Tetris - write a description of the … | |
Hi, I'm working on an algorithm that solves a maze from the inside, and seeks out 1 of the 4 exits on the sides, and after getting 1, it goes to the next until it has them all. The maze is always 22x22, and you only have 400 steps. I … | |
Hi, I'm working on a program that needs to store user info, then can retrieve it at any time, even after it has been shut down and restarted. Is there any way that I can do this? I tried looking online, but couldn't find anything.... | |
Hi, I'm on Christmas Break and am bored out of my mind so i decided that i wanted to write a program that generates a SOLVED Sudoku board, i.e., it has all the numbers filled in. I'm going to write a program later to turn it into an unsolved puzzle. … | |
I don't know how to word this very well, so please bear with me... Is there any way to get a java program to respond in different ways to the results of other programs? Like, if an integer in the other program (not written in Java) is greater than say, … | |
Heh, well, I just realized that i never introduced myself. My name's Neil, I've been learning java for about... 2 1/2 months for school, and about a week ago i started to pick up c++. Just a word of warning, i ask a lot of questions >_< lol. And thanks … | |
Hi, I need to create a huge array of (up to 160,000) points on a grid ex. (4, 23). First of all, I have no idea how to create an array, I looked on the Java API, but I was helplessly and hopelessly confused. And after a create the array, … |
The End.