388 Posted Topics

Member Avatar for cppStudent

speedy patch[code=java] java.util.List<String> lista; @Override public String toString() { lista = new java.util.ArrayList<String>(); example(); return lista.toString(); } private void example() { for (int i = 0; i < 10; i++) { System.out.print(Integer.toString(i) + "\n"); lista.add(Integer.toString(i)); } } [/code]

Member Avatar for cppStudent
0
670
Member Avatar for m_sam6

Install camera driver for your operational system. Download [URL="http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/download.html"]http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/download.html[/URL] JMStudio: jmstudio.exe->File->CaptureDevices->DetectCaptureDevices. See also [URL="http://darnok.org/programming/motion-detection/"]http://darnok.org/programming/motion-detection/[/URL]

Member Avatar for quuba
0
109
Member Avatar for grumpty

In method main write [code=java]Finder thread0 = new Finder(target, 0, 249);//4x change type of Thread->Finder[/code] In constructor Finder 4x change[code=java]this.searchFor = searchFor; // change t. -> this.[/code] Replace[code=java] Thread t = new Thread(this);//Thread.currentThread();[/code] Write own method to start thread.[code=java]//[/code]

Member Avatar for quuba
0
383
Member Avatar for BestJewSinceJC

Posted code not gives base to conclusion. Cast to String? Which part of code want to do it?

Member Avatar for quuba
0
132
Member Avatar for Zass101
Member Avatar for peter_budo
-3
224
Member Avatar for abd640

[URL="http://www.microsoft.com/enable/training/windowsvista/mousekeys.aspx"]http://www.microsoft.com/enable/training/windowsvista/mousekeys.aspx[/URL]

Member Avatar for JamesCherrill
0
141
Member Avatar for petike

If you're into Windows operational system -> Study SUN example: [URL="http://today.java.net/pub/a/today/2006/02/23/smooth-moves-solutions.html"]http://today.java.net/pub/a/today/2006/02/23/smooth-moves-solutions.html[/URL] For your use [code=java]import com.sun.animation.SmoothAnimation;[/code] declare[code=java] SmoothAnimation smoothAnimation;[/code] In constructor [code=java] smoothAnimation = new SmoothAnimation(); [/code] and in your overrided method [code=java] public synchronized void paintComponent(java.awt.Graphics g) [/code] invoke NATIVE method (at end)[code=java] smoothAnimation.vbLock(); [/code] Remember abut [code]VBLocker.dll[/code]

Member Avatar for Ezzaral
0
274
Member Avatar for doha786

Unclosed try{. You have all, what you need. [code=java] void test0() throws FileNotFoundException, IOException { FileReader reader; BufferedReader br; String result = ""; String word = new String(); String target = "friend"; ArrayList<String> names = new ArrayList<String>();//1. // try { //read many files from folder File directory = new File("C:/Test"); …

Member Avatar for doha786
0
116
Member Avatar for redmaverick

Use constructors with radius parameter. In constructor of circle.class calculate area.

Member Avatar for BestJewSinceJC
0
113
Member Avatar for k2k

Inside getRowData() null value[code=java] public Vector getRowData() throws SQLException { ResultSet rs= null;//NULL Vector rowData = new Vector(); try{ ResultSetMetaData rsmd = rs.getMetaData(); //rs =NULL [/code] I made some changes. [code=java] import java.util.Vector; public class Screen { public static void main(String[] args) { DataHolder dh = new DataHolder(); Vector columns …

Member Avatar for k2k
0
285
Member Avatar for bunifrog

Hello bunifrog. Initialize imageLabel. Temporaily delete ProductModified. You can use function with a coefficient value 1.0 or 1.05 to calculate inventoryValue().

Member Avatar for bunifrog
0
140
Member Avatar for denniskhor
Member Avatar for lounestor

Invoke Your functions as functions with (). fee = FlatRate(); //without parameter fee = FlatRatePlus(quantityWater); //with parameter quantityWater.

Member Avatar for lounestor
0
134
Member Avatar for danibarry

Hello danibarry.post # 1; Good describing is 100% of succes. You need only transcribe natural English linguage to java linguage in very simple manner. All base things translate to java classes: From presented text you can derive subsequently set of classes: Aircraft, Bird, Flock (set of birsd- array of Bird), …

Member Avatar for quuba
0
146
Member Avatar for peedi

if (inches = 10) { call setSize(); ??? call setCost(); ??? cost -=2; } call them properly.

Member Avatar for peedi
0
157
Member Avatar for jdbarry

1. Inside calcWasteReduction() check all 4 boolean conditions for 16 cases. 2. Better way is check for 4 boolean conditions (for 4 cases). If true, succesive add coefficients to the local varible. At end multiply this with NumPeople.

Member Avatar for quuba
0
134
Member Avatar for ProgrammersTalk
Member Avatar for cppStudent

Other solution: [code=java] private static BinaryNode getParent(AnyType x, BinaryNode<AnyType> t, BinaryNode<AnyType> parent) { if (t == null) { return null; } else { if (x.compareTo(t.element) < 0) { return getParent(x, t.left, t); } else if (x.compareTo(t.element) > 0) { return getParent(x, t.right, t); } else { return parent; } } …

Member Avatar for quuba
0
1K
Member Avatar for ChaosTheory
Member Avatar for quuba
0
132
Member Avatar for wizzywas

To draw line you need two points. Inside double loop you have access to one of them, current P(i,j). You need additional varibles to remember in the current loops these values, so you can use them on the next loop. [code=java] void paintVertically(Graphics g) { int i0 = 0; int …

Member Avatar for quuba
0
2K
Member Avatar for Thamizh Bharat

Look at Circular Hough Transform, a Java applet demonstration [url]http://www.markschulze.net/java/hough/index.html[/url]

Member Avatar for Thamizh Bharat
0
111
Member Avatar for jdbarry

Inside code you always can insert own test formula. first suspected line while (randNum >= 97 && randNum <= 122) { //a-z randNum = randNumList.nextInt(); } System.out.println(randNum);

Member Avatar for markhogg
0
121
Member Avatar for evilllllll

check declaration of [quote] char playerMove; [/quote] Inside UltimateStrategy and all the consequences of its use

Member Avatar for BestJewSinceJC
0
116
Member Avatar for nikk
Member Avatar for quuba
0
275
Member Avatar for Unebrion

First two basic examples. -How to exchange values between two varibles a and b? Store one if them in temp. temp=a; a=b; b=temp; This method prevents the loss of information. - Write class Counter with one varible int count, constructor Counter(int count) and method [code=java] int getNext(){ int result = …

Member Avatar for quuba
0
141
Member Avatar for meo_beo

little test of program 1. replace your line [quote] pn.setLayout(new GridLayout(5, 1)); [/quote] with [icode] pn.setLayout(new GridLayout(6, 0)); [/icode] 2. replace your part of program [quote] if(cbBlue.getState() == true){ lblInform.setText("You've chosen blue color!"); this.setBackground(Color.green); } [/quote] with [icode] if (cbBlue.getState() == true) { lblInform.setText("You've chosen blue color!"); Component[] componentArray = …

Member Avatar for quuba
0
155
Member Avatar for jsand2

Initialise both [icode] double hourlyRate; // input hourly rate double hoursWorked; //input hours worked [/icode] with -1d value. Inside while-loop refresh them with same -1d value

Member Avatar for stephen84s
0
394
Member Avatar for gokcer

Two ways: throw or catch. Catch this Exception : [icode] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { myButton1ActionPerformed(evt); } catch (Exception ex) { //Logger.getLogger(NewJPanel.class.getName()).log(Level.SEVERE, null, ex); ex.printStackTrace();// or other message JOptionPane.showMessageDialog(... } } [/icode]

Member Avatar for gokcer
0
132
Member Avatar for hell_tej
Member Avatar for leeba

Hello leeba. You can equip you functions in small generators reporting the status of the variables of interest. [code=java] public static int maxSection(String s1, String s2, int counter, int oldCounter) { System.out.println("* " + s1 + " " + s2 + " " + counter + " " + oldCounter); …

Member Avatar for quuba
0
97
Member Avatar for barbz
Member Avatar for barbz

Help done... [code=java] package school; import java.io.*; import java.util.*; public class Palindrome { public static void main(String[] args){ //av advanced, but simpler using generics //av Stack<Character> S = new Stack<Character>();// define data-type of stack Stack S = new Stack();// default data-type of stack Object //av Character letterPush; // push and …

Member Avatar for barbz
0
177
Member Avatar for blackrobe

[code=java] import java.util.Iterator; import java.util.SortedSet; import java.util.TreeSet; public class BlackRobe { public static void main(String args[]) { SortedSet<String> set = new TreeSet<String>(); set.add("beta"); set.add("alfa"); set.add("gamma"); Iterator<String> it = set.iterator(); while (it.hasNext()) { String s = it.next(); System.out.println(s); } } } [/code]

Member Avatar for quuba
0
151
Member Avatar for Alishaikh

TODO Make your BarSelectionSort-class Runnable, Change selectionSort-method void selectionSort(int index) Inside never ending run-method place [icode] if (index < bar_array.length) { selectionSort(index++); } [/icode] set sleep to 500ms Write internal PaintPanel-class extends Canvas with own paint-method (simple move current), place method [icode] public Color getBackground() { return Color.cyan; } [/icode] …

Member Avatar for stephen84s
0
90
Member Avatar for AllenB

[code] private void processConnection() throws IOException { String message = "Connection successful"; ... message = (String) input.readObject(); // read new message displayMessage("\n|" + message + "|"); ///"CLIENT>>> " TO REMOVE! message = message.substring(10); ... [/code] it's all

Member Avatar for AllenB
0
138
Member Avatar for jsand2

Your method setEmpName( [code]PayrollProgram1.setEmpName ( empName );[/code]need to be a static method. [code=java] import java.util.Scanner; // load scanner public class PayrollProgram1{ // set public class public static void setEmpName(String empName) { System.out.println(empName); // EXAMPLE } public static void main(String[] args){ // main method begins Scanner input = new Scanner(System.in); // …

Member Avatar for jsand2
0
68
Member Avatar for radhasb

For class names use first letter big. (public class Table) You need decide where your data is first plane. Inside table-model or inside file? a few clarifications inside code-text -ActionListener - button recognize -Layout -ViewportView scroll bar policy -table.repaint -table-model update [code=java] //DOCUMENT EVERYTHING import javax.swing.*; import java.awt.event.*; import java.awt.*; …

Member Avatar for quuba
0
393
Member Avatar for lonely girl

1. you need coefficients to convert 8 currency among themselves 8*8 2. function to convert text values from JTextField to number

Member Avatar for Ezzaral
0
3K
Member Avatar for amalinaishak

The text is difficult to read. Many parts repeated. I do not have information regarding the form of data from the database. Whether the database is online? What is the difference between the Front / BackJavi / RumiUnicode? What is the difference between-ke, di-,di_Abd? (sufix,prefix,infix). What is the meaning of …

Member Avatar for quuba
0
154
Member Avatar for kedakai

If you want to have all in one file remove this ==> [quote] this id for the next page: import javax.swing.*; import java.awt.*; [/quote] Your main() function is inside LoginDemo-class Save your project as LoginDemo.java file ! compile and run LoginDemo [code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; class Login …

Member Avatar for kedakai
0
167
Member Avatar for Superstar288

CONCEPT (paper & pencil) This is database. You have a input Record: (supplierName, date, animalName, price). Now is time to make a model. Only 4 fields. What is relation beetwen them. I started from end. Pair (animalName, price) is inextricably linked. [quote] Animal: -name -price [/quote] Purchase is relate to …

Member Avatar for Superstar288
0
149
Member Avatar for Thamizh Bharat

[QUOTE=Thamizh Bharat;765880] * How to launch a java application at startup in windows and linux? [/QUOTE] In windows place bat-file, jar-file or shortcut inside [icode]C:\Documents and Settings\<USER>\Menu Start\Programs\Autostart[/icode]

Member Avatar for PhiberOptik
0
126
Member Avatar for hctstudent

[quote] Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994) at java.lang.Double.parseDouble(Double.java:510) at MainClass.actionPerformed(MainClass.java:263) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) [/quote] Read carefully runtime errors! By default your TextField-s are initialized with empty String ==> "" Initialize them with String representation of zero ==>[icode]textFieldxxx.setText("0");[/icode] But this is only half of work. You need indicate …

Member Avatar for quuba
0
126
Member Avatar for caren921

Post whole Credentials-class. In first view, your static method should [icode]return o;[/icode] not [icode]return null;[/icode] [code=java] public class HappyNewYear{ public static void main(String[] args) { String VSnumber = "VSnumber"; String emailaddress = "emailaddress"; String password = "password"; Credentials myCredentials = Aaaaaaaaaaa.verifyCredentials(VSnumber, emailaddress, password); // now you have outside-acces System.out.println("Returned: " …

Member Avatar for quuba
0
109
Member Avatar for Mr.UNOwen
Member Avatar for srs_grp

base [URL="http://java.sun.com/docs/books/jls/"]http://java.sun.com/docs/books/jls/[/URL] [icode] Float f = -Float.MIN_VALUE; Integer i = Float.floatToIntBits(f); System.out.println(Integer.toBinaryString(i)); System.out.println(Integer.toHexString(i)); Integer j = Float.floatToRawIntBits(f); System.out.println(Integer.toBinaryString(i)); System.out.println(Integer.toHexString(i)); //10000000000000000000000000000001[/icode] also explore javadoc,sourcecode of ==>java.lang.Float ,java.lang.Double funny number, isn't it?

Member Avatar for srs_grp
0
186
Member Avatar for Eggplant

Use a suitable tool for creating software. Use free IDE NetBeans.[URL="http://www.netbeans.org/downloads/"]http://www.netbeans.org/downloads/[/URL]

Member Avatar for Eggplant
0
390
Member Avatar for confusedGirl

[icode] if (sc.next().equals(CustomerName)) { dataList.add("The Searched word is : " + CustomerName + sc.next()); }[/icode] In this part of program You are using two times [icode]sc.next()[/icode] every call returns NEXT value. Use once [icode]String any=sc.next()[/icode] and later use [icode]any[/icode]

Member Avatar for Ezzaral
0
343
Member Avatar for deven1974

Implement the insert, remove, and search methods of the BinarySearchTree class This mean: override abstract methods of abstract class Tree<E> [icode] protected abstract Node<E> remove(Node<E> curr, E data) throws TreeException; protected abstract boolean search(Node<E> curr, E key); protected abstract Node<E> insert(Node<E> curr, Node<E> node); [/icode] In public class BinarySearchTree you …

Member Avatar for quuba
0
217
Member Avatar for dnmoore

Generics in the Java Programming Language Gilad Bracha July 5, 2004 [URL="http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf"]http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf[/URL]

Member Avatar for quuba
0
186

The End.