388 Posted Topics
Re: 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] | |
Re: 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] | |
Re: 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] | |
Re: Posted code not gives base to conclusion. Cast to String? Which part of code want to do it? | |
Re: [quote]$5![/quote] is $120. Invest this sum in your education. | |
Re: [URL="http://www.microsoft.com/enable/training/windowsvista/mousekeys.aspx"]http://www.microsoft.com/enable/training/windowsvista/mousekeys.aspx[/URL] | |
Re: 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] | |
Re: 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"); … | |
Re: Use constructors with radius parameter. In constructor of circle.class calculate area. | |
Re: 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 … | |
Re: Hello bunifrog. Initialize imageLabel. Temporaily delete ProductModified. You can use function with a coefficient value 1.0 or 1.05 to calculate inventoryValue(). | |
Re: Open project in NetBeans IDE, or add throws clause manually. | |
Re: Invoke Your functions as functions with (). fee = FlatRate(); //without parameter fee = FlatRatePlus(quantityWater); //with parameter quantityWater. | |
Re: 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), … | |
Re: if (inches = 10) { call setSize(); ??? call setCost(); ??? cost -=2; } call them properly. | |
Re: 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. | |
Re: 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; } } … | |
Re: Inside Timer3 you can change all parameters of a_timer, vehicle. | |
Re: 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 … | |
Re: Look at Circular Hough Transform, a Java applet demonstration [url]http://www.markschulze.net/java/hough/index.html[/url] | |
Re: 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); | |
Re: check declaration of [quote] char playerMove; [/quote] Inside UltimateStrategy and all the consequences of its use | |
Re: Try to search with a specific key [quote]"new QDGraphics"[/quote] | |
Re: 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 = … | |
Re: 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 = … | |
Re: 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 | |
Re: 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] | |
Re: check your .java and .form file in other txt-editor or start new JFrame Form. | |
Re: 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); … | |
Re: char c = 'a'; String s = new String("" + c); | |
Re: 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 … | |
Re: [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] | |
Re: 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] … | |
Re: [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 | |
Re: 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); // … | |
Re: 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.*; … | |
Re: 1. you need coefficients to convert 8 currency among themselves 8*8 2. function to convert text values from JTextField to number | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [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] | |
Re: [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 … | |
Re: 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: " … | |
Re: 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? | |
Re: Use a suitable tool for creating software. Use free IDE NetBeans.[URL="http://www.netbeans.org/downloads/"]http://www.netbeans.org/downloads/[/URL] | |
Re: [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] | |
Re: 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 … | |
Re: 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] |
The End.