32,204 Topics
| |
I would like to make it so that when a character (picture or shape) moves it leaves a trail behind it that keeps getting more transparent. how would i start. If you jump the trail should follow up then down. Can anyone help me? Thanks | |
Hello all, I'm making a simple game in minesweeper, and I have a Mine class with a JButton and some other information, namely an x and y variable for its location. In a class called Board, a constructor creates a multi-dimensional array of Mine objects. I tried adding mouselistener to … | |
Hi! Please, tell me how to make the JDialog close button working in a proper way. Now it does not work. [ICODE]System.out.println(value);[/ICODE] produces 0. But if I write [ICODE]if (value == 0)[/ICODE], then nothing happens. Any ideas? Thanks! [CODE] public static void about() { final JOptionPane optionPane = new JOptionPane( … | |
...How to make an Applet using a Panel consisting FOUR different Layouts(FlowLayout, GridLayout...etc...) that shall make an output of 9 Buttons in a 3x3 layout... ... | |
The program must simply ask the user to type in a text since a text is a list of words separated by spaces. i need it..its really urgent..thanks.. | |
how to modify the contents of a file Example:: If there is a file with hello #how are you Then how to delete the # and maintain the same file | |
I've recently posted a thread called file modification and the problem has been solved........now could some1 kindly explain why is it necessary to delete and rename the file to insert or delete a character into the file at a particular location Thanks | |
How would you go about skipping non-numeric characters in a string and only adding the sum of the numbers a multi line string? | |
Hey guys I am still learning how to use simple java. I want to try to do this program which i found in some book, but i cant seem to get how to started. They say its a beginners program, but i found it quite difficult on how to start. … | |
OK, here's what I want to do (I realize the code below doesn't work, but it's what I would LIKE to do). I've converting things from C++ [code=JAVA] public void ChangePrimitiveArray(byte bytes[]) { bytes[0] = 1; } public void foo() { byte bytes[] = new byte[2]; bytes[0] = 4; ChangePrimitiveArray(bytes); … | |
Hi im working on this program im getting a runtime error that says this ArrayIndexoutofbounds exception 0. heres my code [code] import java.util.Scanner; public class MillerCalculateTime { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter miles: "); double miles = sc.nextDouble(); System.out.print("Enter Miles per hour: "); … | |
i have to construct a rectangle, print the location, then translate/print it 3 more times such that if they were drawn, they would form one large rectangle. [][] <- like so [][] here's the code & the error. C:\java>javac FourRectanglePrinter.java FourRectanglePrinter.java:11: [COLOR="Green"]incompatible types[/COLOR] found : void required: java.awt.Rectangle Rectangle box1 … | |
Hi! I would like to read XML file from my SWING application, however [ICODE]list.size()[/ICODE] returns 0. Why does it happen? Thanks! [CODE] private void open() { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File(openedFileName()); try{ Document document = (Document) builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren("Panel"); … | |
Hi! I would like to select images by using a rectangular area. All images that are inside this area, must be selected. I want this area to appear while mouse clicking and dragging. So, the size of a rectangular area should change dynamically according to a position of the mouse … | |
[code=java]import java.text.DecimalFormat; import java.util.Scanner; public class Main { public static void main (String[] args) { String inputString; //For reading input. String input; //Read Input double automobileCost; double warrantyCost; double downPaymentAmount; double interestRate; double numberPayments; double salesTaxAmount; double totalPurchaseCost; double amountFinanced; double loanInterestRate; double loanLength; double monthlyPayment; double annualInterestRate; // Create … | |
This is more than likely the dumbest sounding problem most of you will have ever heard of, but after three days of attempting to fix this myself, I have gotten no where. I am working on an older project, it works fine, but I need to upgrade it an add … | |
Hi all, ive got a problem relating to the log4j.jar file (I suppose it would be the same problem regardless of what the .jar file is). I created a library based off the log4j.jar file, and the logging works and everything runs smoothly on my laptop. However, when I use … | |
Hello, I am having a hard time with a easy problem. I need to ask a user how many scores they would like to enter (up to 15) and then use a method to get the number of scores. in the form of Enter score 1: xx.xx Enter score 2: … | |
I have hundreds of text files with data sorted in 3 columns and an unspecified number of rows. The number of columns can increase in the future, but will always be equal for all files. I want to combine these data into a single file with all the columns put … | |
Hey guys! This is the code for a program I started today: [code=java] /* * IdeaCaptureMain.java * * Created on Jan 25, 2011, 4:33:45 PM */ package Idea; /** * * @author WolfShield */ public class IdeaCaptureMain extends javax.swing.JFrame { /** Creates new form IdeaCaptureMain */ public IdeaCaptureMain() { initComponents(); … | |
| |
I have been doing an assignment for my my first year software course, in which we have to make a simple TicTacToe program in java. For the final 30% mark, we have to add a GUI in. Apart fro a tutorial only teaching me the basics (how to make boxes … | |
[CODE]public void buildTree(List<Fool> treeArr,Fool tr) { if(tr.getChild().size() == 0) { for (Fool cur : treeArr ) { if (cur.getParentId().intValue() == tr.getRight().getRightId()) { tr.getChild().add(cur); cur.setParent(tr); buildTree(treeArr, cur); } } } }[/CODE] there is around 10000 data, and the code is very slow. Its taking 8.5 second, I need to speed it … | |
I was wondering if someone could check this for me. Ive to write a loop in words, this is what ive came up with. while (there are days left in holiday) if (sunny) go to beach else go to swimming pool go home Basically its a program that tells you … | |
Hi Can some one give me some idea about code for icp protocol for client server Architecture in java. Thanks | |
Hello Members, Can anyone point me to a web link which has the java code for a simple game that uses the keyword synchronized and the thread synchronization functions, wait() and notify()? Thank you! | |
Hey Everyone, How would you go about writing a program that draws an image of an ice cream cone, using JFrame and JComponent classes, with a triangle on bottom and a circle on top? | |
Hi, am trying to use a multicast socket in an application but I constantly get this exception; java.net.SocketException: error setting options. I have failed to find its cause and how to solve it. Pliz help (what could be causing it, and how can i solve it? thanx. | |
why when i write this down : [CODE] private Statement getOrders_st=null; public ResultSet getOrders(String UserName) { ResultSet Rs=null; try { getOrders_st = Conn.createStatement(); Rs = getOrders_st.executeQuery("select order_history , ordr_date , ordr_total from orders where ordr_userid = '"+UserName.toLowerCase()+"'"); } catch(SQLException ex) { ex.printStackTrace(); } return Rs; }[/CODE] give NullPointerException at [CODE]getOrders_st … | |
There is a working code about a program in which you should create differen Cat objects with name and color parameter and apply method to the objects. The problem is that I get the method working for only the last cat [CODE]public class Cats { public static String name; public … |
The End.