32,204 Topics
| |
Hi everyone, how do i push item with a givin index in a linkedlist. e.g. linkedlist.add(element e, int index); this is my function [CODE]public void push(Student s, int index){ if(isEmpty()){ start = s; }else{ last.next = s; } last = s; size++; }[/CODE] | |
Hi! I would like to develop a software that will allow me to find a file (using JFileChooser) on a local machine and save it to a remote machine. I know an IP address of the remote machine. Please, give me some explanations or a link to some tutorials regarding … | |
I want to set up a connection to a Microsoft SQL Server 2005 express on my PC. [code=java] try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/db1","xxxx","yyyy"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT nume FROM tabel1"); while (rs.next()) { String s = rs.getString("name"); textArea.append(s); } } // Catches any … | |
Is there anyway to play an mp3 file in java? P.S I'm new here, hello world? | |
The problem is that when we use multiple threads and each containing System.out.println(). It doesnt print at time according to what i think it shoud On implementing the below 2 codes: [CODE] import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.SocketException; import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Level; import java.util.logging.Logger; class E { LinkedBlockingQueue<DatagramPacket> li = … | |
Hi. I can't figure out how to remove an element from an array. will I have to move get the element to be removed and swap it out with the last element and use the pop()? | |
Hello, I am a current Java student and am having a problem when I run my compiled program from an in chapter lab assignment called "Stock Tracker". I receive a message from a dialog box "Cannot locate sun.jdbc.odbc.jbcOdbc Driver. Class not found exception creating database object. Following are a list … | |
[CODE] public class Reservation { private String firstname; private String lastname; private String address; private String name; private int licenseN; private String date; private int daysN; private String type; public Reservation(String f,String l,String a,int lpn,String dt,int nd,String tp) { firstname = f; lastname = l; address = a; licenseN = … | |
Hi, I have a jsp web application running in Tomcat 6 that uses a set of 3rd party jars. One of the jars is attempting to load a log4j property file by using a relative path. ( \folder\.properties) I have the property file but I need to know where to … | |
Ok so Im trying to create a constructor that reads input from a text file. Which I got it to do. Then adds the information to a LinkedList. [CODE] public class CourseCatalog<T> { private BufferedReader read; private LinkedList<Course> catalog; public CourseCatalog(String filename) throws FileNotFoundException { catalog = new LinkedList<Course>(); try … | |
Can anybody help me how to transfer the inputting of my numbers from left to right... Well here is my program.. [code] import java.awt.*; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; public class Calculator2 extends JPanel implements … | |
Hi! I have a project in school about a grocery list...can someone help me make a code for this? I really need it....thank you so much! here's the problem: This application is called the “DAWLIMs Grocery Store”. The team has closed a contract deal to develop an application of a … | |
I have a tree, and I want to find the depth of it. For example for this tree: [CODE]0 root / \ 1 5 1 / \ 2 1 3 | 3 2[/CODE] It should give a depth of 3. [CODE] public int getDepth() { int maxDepth = 0; if(this.hasChildren()) … | |
Okay so I have to have write a program that takes website names until you type stop. After that it should count how many websites were entered. [CODE]package website; /** * * @author */ import java.*; import java.util.Scanner; public class Main { /** * @param args the command line arguments … | |
Does anyone know how to hack passwords, like Facebook or email through Java? | |
[CODE]public double returnTotalFine(){ if (parkingmeter.returnPurchasedMins() >= parkedcar.returnMinsParked()){ fine = 0; } else if (parkingmeter.returnPurchasedMins() - parkedcar.returnMinsParked() <= 60){ fine = 25; } else{ fine = (25 + (10 * (parkedcar.returnMinsParked() / 60.0))); } return fine; } [/CODE] this is the toString method from the same class as above: [CODE]public String … | |
| Here's the pattern: [CODE]******* ***** *** * ** *** ***** ********[/CODE] Here's the code I used to get only the first part(the up-side down triangle): [CODE] class hourglass { static void pattern() { for(int j=1;j<=4;j++) { for(int i=1;i<=j;i++) { System.out.print(" "); } for(int i=7;i>j;i--) { System.out.print("*"); } System.out.println(); } } … |
Hi, I wanted to know how you can link two list Boxes together. This is what I'm trying to do: [B]I'm creating two list boxes, list box A and list Box B. List Box A is a list of different departments. When the user clicks on a particular department, the … | |
hey guys, just one question- how do i get netbeans to import a whole folder (containing numerous java files)? the only option i currently get is to import eclipse projects. | |
[code] package cls; public class main34 { public static void main(String[] args) { for(int i = 2; i <= 100; i++) { for(int j = 2; j <= i; j++) { if(i % j == 0) { break; } else { System.out.println(i + " "); } } } } } … | |
i am trying to send AT commands on a GSM modem. this is my code.. [CODE]import java.io.*; import java.util.*; import javax.comm.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String commands[] ={"AT+CMGS=1","AT+CMGS=\"+919007413343\","Hello there"}; static byte[] newline[]={(byte)13,(byte)10}; static SerialPort serialPort; static OutputStream outputStream; public static void main(String[] args) … | |
I am trying to make a program that outputs a triangle and the program then should asks the user to enter the size of a triangle to print on the screen. After getting this number, the program should then print a triangle to the screen by printing a series of … | |
public class Strength3 extends ConsoleProgram { private static String[] blank; private static String it; public void run(){ blank = new String[5]; for (int i=0; i<5;i++){ blank[i] = "-"; it+=blank[i]; } println(it); } } why does it print 'null' first. all i want is just 5 hyphens...thanks | |
how to make video lecture application??have any idea??help me please :'( | |
hi... I have some questions... Firstly, I have an ArreyList that is stored two String "Name", "Description" This is a database of students [CODE]private void addStudents () { addStudent("ABC","lalala"); addStudent("DEF","hohoho"); }[/CODE] I also have the methods that adds, modify and delete students from the term list. [CODE]protected boolean addStudent (String … | |
Hi everyone.... I want to develop a music lexicon (tyoe band name --> give description) and I want to add terms (bandName and description) I use ArrayList but I want to change. I have also the code that read a [B]text [/B]file (bands.txt) but I dont know haw it works... … | |
Firstly... I am a new in Java... I have a music dictionary that use an arreylist to store the terms and definition The user use the terminal to interact with this dictionary. [CODE]private void addTerms () { addTerm("Anathema","Atmosheric metal band from Liverpool, UK." } [/CODE] Because, I would like to … | |
hello friends i m larning core java.i want some write code of some program by in which i can use the concept of opertors,inhertance so plz me assignment so that i can do practic. | |
I'm trying to see if someone can help me with two issues with my program. It compiles fine without errors, but some of my numbers in my amortization table only gives me one number after the decimal place and others give me two numbers. I was wondering if something in … | |
i need to get the output of 1 2 4 7 11 16 22 i know im on the right track however i cant figure out a way to get the outputs in the right form like 1+2+3 etc like its doing in the output i should get. i know … |
The End.