32,204 Topics
| |
ok, so i have lots of audio in my program that only plays once, and that all just works fine and perfect This is what i do to play music [CODE] try { InputStream a = new FileInputStream ("Sounds-Music/MainTheme.wav"); theme = new AudioStream (a); } catch (java.io.IOException z) //catching the … | |
| I need help with an add boolean method in a singly linked list, The only difference is that i start off with a dummy head. The method's job is to add non-repeating objects to the linked list. Please help: [CODE]public boolean add(Object newData){ Node current = head.getNext(); Node v = … |
Hi guys I have what I think is a really simple problem but I just don't seem to GET Linked Lists or at least how the nodes work. I have a class that implements these methods: public boolean add(Object newEntry); public boolean add(int newPosition, Object newEntry); public Object remove(int givenPosition); … | |
:-/ Is there any function in MouseListener that returns the x- and/or y-coordinates of the cursor relative to the origin of a JPanel which currently has the focus? ¡Ayúdenme, por favor! | |
hello. i have created String name,surname,country; int age; and a scanner which takes informations from keyboard. and this print lines: System.out.println("Name\t Surname\t Age\t Country); System.out.println(name+"\t"+surname+"\t"+age+"\t"+country); NORMALLY: EX: Name Surname Age Country JOHN smith 35 uk but IF NAME HAS TOO MANY CHARS IT IS NOT DISPLAYED IN THE SAME COLUMN. … | |
[CODE]import java.util.*; import java.lang.*; import java.io.*; class wordOccur { public static void main(String[] a)throws Exception { int i; int[]f=new int[20]; System.out.println("Enter the Sequence of the String:"); Scanner s=new Scanner(System.in); for(i=0;i<f.length;i++) f[i]=0; String t=s.nextLine(); count(t); } static void count(String t) { int[] f=new int[14]; int i; String d=" "; String[] temp=t.split(d); … | |
Hello everyone, Im working on a task where I have to implement an array list based complete binary tree but im not too sure how to do so. My java knowledge is very basic, whilst I could implement a normal binary tree, when its array list based im clueless. I … | |
HELP ME PLEASE. I AM A 1ST YR COLLEGE STUDENT :/ Define an interface Filter as follows: public interface Filter { boolean accept(Object x); } Modify the implementation of the DataSet class to use both a Measurer and a Filter object. Only objects that the filter accepts should be processed. … | |
Java error- java:12: class, interface, or enum expected? class ProgrammingProject01 { public static void main(String blabla[]) { System.out.println("Hello"); World world1 = new World(); Turtle turtle1 = new Turtle(world1); } } public void drawN1() { this.penUp(); this.moveTo(50,50); this.penDown(); this.setPenWidth(5); this.setColor(new java.awt.Color(255, 0, 0)); this.turn(180); this.forward(50); this.turn(180); this.forward(50); this.setColor(new java.awt.Color(255, 200, 0)); … | |
This is a plate, requirement for our semifinals. Enhance the addInterest method of the SavingsAccount class to compute the interest on the minimum balance since the last call to addInterest. Hint: You need to modify the withdraw method as well, and you need to add an instance field to remember … | |
Hi all, I'm working on a project for my CS class to go a little above and beyond the requirements. I have a simple GUI that takes in a username and password and checks a few things (needs uppercase and digit, etc), but I'm trying to have a JLabel that … | |
[CODE] class Circle { private double radius; private String colour; Circle() { } Circle(double r, String c) { this.radius=r; this.colour=c; } public void display() { System.out.println("Radius of circle is "+this.radius); System.out.println("Colour of circle is "+this.colour); } public String getColour() { return (this.colour); } } [/CODE] how calculate and display the … | |
Hello, can anyone explain me why I'm still one step behind with this code? [CODE]private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) { try { DefaultTableModel model=(DefaultTableModel)jTable1.getModel(); model.setNumRows(0); String Name=jTextField1.getText(); String sql= "SELECT * FROM APP.Workers WHERE First_Name LIKE'" +Name+ "%'"; rs= stmt.executeQuery(sql); while (rs.next()) { String d1=(rs.getString("First_Name")); String d2=(rs.getString("Last_Name")); String d3=(rs.getString("Job_Title")); String d4=(Integer.toString(rs.getInt("ID"))); … | |
how to write code include a try-catch statement to handle exception of this code. In the catch() statement, will provide a proper alert to the user on the error occurred. [CODE] import java.io.*; import javax.swing.JOptionPane; class TestArray { public static void main (String []args) { double a; double w; double … | |
I have problem when itegrate my webcam with JMF. I have got this following error, when i running JMFINIT or running jmfregistry and detect capture device. [CODE] Trying 6 352 288 Trying 6 768 576 Trying 7 160 120 Trying 7 320 240 Trying 7 640 480 Trying 7 176 … | |
Hey! I got a Java Project which runs fine when i call the Main class with the java command. Made it into a -jar file with: jar cmfv manifest kort.jar * the manifest file contains [code] Main-Class: src.KortBord [/code] with the line break at the end when i try to: … | |
Hi, I am experiencing memory leak in the activemq. i ran yourkit profiling tool and came up with the following leak as the top two. org.apache.activemq.command.activemqmessage org.apache.activemq.command.messageId is there any solution for this? Thanks | |
Hi and Greetings, I am new to these forums, so if I submitted this to the wrong forum, my apologies. Before I get to my question, a little backstory. I was running an application on my laptop that was using Microsoft Vista, with Microsoft Office 32 bit and JRE 1.5. … | |
I'm fairly new to java and need help. I need to show time required to travel somewhere by having the user input Speed and Distance traveled. And the outcome be a floating point value. lets say they put in 60 mph and 148 miles I Can't seem to get the … | |
Hi, I have a Java Final exam after few days. And I am looking for some website that contains [B]SOLVED [/B]programming exercises. Can anyone give me at least one site? Note: what I mean by [B]SOLVED [/B]is that I want the exercises to have solutions with them because I want … | |
| I can't seem to figure out how to separate the code I wrote into 3 separate methods. 1. The main method, 2. the method that creates the strings i need and sends em back to the main method, 3. and the method that displays the if statement. [CODE]import java.io.*; import … |
Hey I am a student and i am new on the algorithm subject. I have been given a compulsory assignment that is to set up a program that have Liked list with Nodes. The problem is that i dont understand how to do this: - remove the first node - … | |
Hello there.i have to find if elements of a row are equal to elements of another row.this is my code but it wont work. when k becomes 1, i want the for loop at i to start with i=2; can you help ????? int b[][]={ {1,2,23,4,5}, {6,1,8,9,28}, {11,12,13,14,15}, {1,17,18,19,20},}; for(int … | |
Hey I would like to do a ".bat' type of command in Java: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a … | |
Hi, I am trying to make a game board in java. The idea is that the user will enter the length and this will be squared and the board with corresponding number of squares will be displayed. Any ideas on how to do this? I know it'll involve some kind … | |
Hi all, I'm working on a school project and I am running into a problem, possibly more... This is my first post, so I am sorry if it ends up ugly. Here is a description of the project: This project focuses on demonstrating your understanding of classes and objects. Before … | |
i want create jar file of my source code using netbean but i dont know how to do that please help! | |
shell-scripting @ DaniWeb - Hello fellow members, I would like to ask for your assistance in creating a batch/autorun/exe file which can help me to make an autorun usb. So basically, I would like the USB to do the following: When usb is inserted, it should autorun and copy files … | |
I had to make a arrayList and i do not know why is it not working [CODE]public class ArrayList<E> { private E[] theArray; private int size; private int capacity; public ArrayList(int initialCapacity) { this.size = 10; this.capacity = initialCapacity; theArray = (E[]) new Object[initialCapacity]; } public ArrayList() { this(1024); } … | |
I have an array where of integers that has to be sorted and inserted into the correct place in the array for each number, not just at the end. All of this is done in the add method. This is what i have so far. [CODE]package sortedintlist; public class SortedIntList … |
The End.