32,204 Topics

Member Avatar for
Member Avatar for Donnovan

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]

Member Avatar for Donnovan
0
98
Member Avatar for LianaN

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 …

Member Avatar for LianaN
0
3K
Member Avatar for Buffalo101

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 …

Member Avatar for Buffalo101
0
248
Member Avatar for mangopearapples

Is there anyway to play an mp3 file in java? P.S I'm new here, hello world?

Member Avatar for mangopearapples
0
167
Member Avatar for purijatin

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 = …

Member Avatar for purijatin
0
233
Member Avatar for ceyesuma

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()?

Member Avatar for ceyesuma
0
296
Member Avatar for birdlover2010

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 …

Member Avatar for ~s.o.s~
0
271
Member Avatar for AlvinLiu

[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 = …

Member Avatar for AlvinLiu
0
2K
Member Avatar for rfencl

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 …

0
112
Member Avatar for Barnifericus

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 …

Member Avatar for jon.kiparsky
0
112
Member Avatar for nope3d

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 …

Member Avatar for Nishkalank
0
200
Member Avatar for compe_dsd

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 …

Member Avatar for compe_dsd
-1
199
Member Avatar for Awesomeness

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()) …

Member Avatar for Awesomeness
0
110
Member Avatar for SomeNewGuy

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 …

Member Avatar for kramerd
0
111
Member Avatar for Haile12

Does anyone know how to hack passwords, like Facebook or email through Java?

Member Avatar for peter_budo
-2
91
Member Avatar for plasticfood

[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 …

Member Avatar for plasticfood
0
58
Member Avatar for sravan953

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(); } } …

Member Avatar for Ezzaral
0
695
Member Avatar for someone5

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 …

Member Avatar for someone5
0
195
Member Avatar for Dhruv Gairola

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.

Member Avatar for Dhruv Gairola
0
135
Member Avatar for vbx_wx

[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 + " "); } } } } } …

Member Avatar for apines
0
85
Member Avatar for debasishgang7

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) …

Member Avatar for JamesCherrill
0
173
Member Avatar for DallasFan3

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 …

Member Avatar for wilsonz91
0
1K
Member Avatar for akinfemi

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

Member Avatar for kramerd
0
80
Member Avatar for pRincezZ_fe
Member Avatar for Taywin
0
86
Member Avatar for chmo

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 …

Member Avatar for masijade
-1
395
Member Avatar for chmo

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... …

Member Avatar for masijade
0
540
Member Avatar for chmo

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 …

Member Avatar for masijade
0
373
Member Avatar for ajay_tabbu

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.

Member Avatar for masijade
0
195
Member Avatar for etrac1912

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 …

Member Avatar for Eric Cute
0
94
Member Avatar for frankel81

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 …

Member Avatar for Eric Cute
0
149

The End.