388 Posted Topics
Re: This phenomenon is characteristic for all linear congruental generators. [URL="http://www.frankfurt-school.de/dms/publications-cqf/Monte_Carlo_Seminar_Slides/GeneratingRandomNumbers_Shevchuk/GeneratingRandomNumbers_Shevchuk"]http://www.frankfurt-school.de/dms/publications-cqf/Monte_Carlo_Seminar_Slides/GeneratingRandomNumbers_Shevchuk/GeneratingRandomNumbers_Shevchuk[/URL] | |
Re: Base condition - use any java editor or IDE (NetBeans,Eclipse,BlueJ....) What is this ? [icode]public static void main(String[] args);[/icode] Post formally proper code. quuba | |
Re: I try this part of your program with my xml-file [icode] //and my .... continuation Element element = doc.getDocumentElement(); System.out.println(element.getTagName()); // is OK [/icode] further code related to [icode] XPathFactory xpfactory = XPathFactory.newInstance(); XPath path = xpfactory.newXPath(); //.... [/icode] you not posted, also i don't know what is inside "Bank.xml" … | |
Re: redundant info, delete [icode] private int geboorteDag; private int geboorteMaand; private int geboorteJaar; [/icode] use geboorteInformatie.get(XXX); All the data are stored inside Calendar geboorteInformatie; use constructor : [icode] GregorianCalendar(int year, int month, int dayOfMonth) [/icode] Attention, from javadoc: Month value is 0-based. e.g., 0 for January Make proper corrections to … | |
Re: in Customer class override method [icode] public String toString(){ return //..... all data about customer } [/icode] | |
Re: BASE. I strongly recommend you think of categories of object-oriented language. Create your own classes: [icode]Airplane[/icode] and [icode]Seat[/icode] Life will become easier. - Whether teachers have forgotten about OOL/OOP? - What do you think about this? | |
Re: change name of your class (line 16) [icode]Vector[] VectorArray = new Vector[35];[/icode] to avoid confusion with library class java.util.Vector | |
Re: In "pl" contry running too [URL="http://www.google.com/webhp?complete=1&hl=pl"]http://www.google.com/webhp?complete=1&hl=pl[/URL] but Google esperanta NO [URL="http://www.google.com/webhp?complete=1&hl=eo"]http://www.google.com/webhp?complete=1&hl=eo[/URL] quuba | |
Re: [QUOTE=Ezzaral;753050]First thing: try taking "public void moveTriangle" method out of the toString() method.[/QUOTE] How far? --------------- TAboy24 try this [icode] boolean isIsosceles() { //checking if the triangle is isosceles.... if (getLengthOfSide(p1, p2) == getLengthOfSide(p2, p3)) { return true; } else if (getLengthOfSide(p2, p3) == getLengthOfSide(p3, p1)) { return true; } … | |
| |
Re: use [icode]JPanel p = new JPanel() { @Override public Dimension getPreferredSize() { return new Dimension(100, 100); } public Dimension getMinimumSize() { return new Dimension(100, 100); } public Dimension getMaximumSize() { return new Dimension(100, 100); } };[/icode] Other methods of JPanel class You can overwrite here if You want. Such thinking … | |
Re: [icode] if (count == 1) { System.out.println("Valid ID"); } else { System.out.println("Invalid ID"); throw new InvalidIDException(); } } public static void main(String[] args) throws InvalidIDException { int number = Integer.parseInt(args[0]); CheckNumber(number); }[/icode] | |
Re: try to search [icode]M766[/icode] [URL="http://www.ookz.com.pl"]http://www.ookz.com.pl[/URL] Other place [URL="http://members.driverguide.com/index.php?companyid=796&devicetypeid=1&qm0=&ref=&action=wizard_step_3&company=796&Submit=++SELECT+COMPANY+%3E%3E++"]http://members.driverguide.com/index.php?companyid=796&devicetypeid=1&qm0=&ref=&action=wizard_step_3&company=796&Submit=++SELECT+COMPANY+%3E%3E++[/URL] Check your MOBO with Everest for more info. quuba | |
Re: In Your code [icode]int x,y;[/icode] are indexes of loop - for. When loops finished x=0 and y=0.Multipy them result is 0. You not using [icode]char[] ch={'1','2','3','4','5','6','7','8','9'};[/icode] table. More proper is declare table as int. Analyse this: [code=java] public static void main(String[] args) { int[] table = {9,8,7,6,5,4,3,2,1,0}; for (int x … | |
Re: [URL="http://java.sun.com/products/java-media/sound/techReference/javasoundfaq.html"]http://java.sun.com/products/java-media/sound/techReference/javasoundfaq.html[/URL] quuba | |
Re: [icode] public void formHeapTree() { int unsortedSet[] = new int[noDataElements];[/icode] Certainly [icode] int unsortedSet[][/icode] hides Your previous declaration -> delete [icode]int[/icode] quuba | |
Re: [code=java] class TestTable { public static void displayCity(City c) { System.out.println(c.getKey()); } // end displayCity // Main entry point public static void main(String[] args) { TableInterface<City, String> chart = new TableBSTBased<City, String>(); City c; c = new City("Narragansett", "USA", 12000); chart.tableInsert(c); c = new City("Ocracoke", "USA", 3000); chart.tableInsert(c); // If … | |
Re: We can multiply/divide by 2 succesive using bitwise operators . [icode] byte a = 4; byte b = (byte) (a >> 1); byte c = (byte) (a >> 2); byte d = (byte) (a << 1); System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d); [/icode] May be You are looking to The Vedas (Sanskrit … | |
Re: write [icode]public class BackGround extends Applet implements Runnable {[/icode] You must overwrite function run() Make never ending loop inside run() Introduce varible [icode]Thread thread;[/icode] In function init() started thread Declare [icode]Random rnd = new Random(); [/icode] and randomZZ varibles without [icode] paint(Graphics g)[/icode] body Assignment of new values of randomZZ … | |
Re: Hello efus. in inorder() function you have a line [icode]System.out.print(" " + data);[/icode] Replace this static method with own. Succesive collect nascent data in external buffer. buffer can be placed in own singleton class. 0. Initialize external buffer; --------------------------------- 1. Invoke root.inorder(); 2. Get external buffer as String 3. Clear … | |
Re: Hello Ebiz [code=java] public static void readMatch() throws FileNotFoundException { JFrame frame = new JFrame("Display File"); JTable table = new JTable();//Creating a new JTable List<String> columnData = new ArrayList<String>(); //Creating a List to store String data JFileChooser chooser = new JFileChooser(); //Creating the File Chooser int status = chooser.showOpenDialog(null); //setting … | |
Re: hello Grub [icode]row - 1[/icode] where row can be 0, and result is -1. quuba | |
Re: hello efus 1. To have a reference to tree You need declare [icode] Node root = null;[/icode] ,and change this systematically. 2. Better way is declare stack as below [icode] Deque<Node> stack = new ArrayDeque<Node>();[/icode] 3.In class Node declare [code=java] public String toString() { return "[" + data + "L" … | |
Re: hello poggie Try decompose program to set of classes. One can be a BingoCard.java class: -define inside integer 2D structure 5x5, -define constructor, -define needed methods In this case concentrate on problem what a BingoCard is. It has a columns,rows , diagonals (always 2). You should check if given number … | |
Re: hello goyofoyo [code=java] import java.awt.Color; import acm.graphics.*; import acm.program.*; public class pacMan extends GraphicsProgram { int startpoints[] = {0, 15, 30, 45, 30, 15}; int sweeppoints[] = {360, 330, 300, 270, 300, 330}; int index = 0; public void run() { setSize(800, 600); GArc pac = new GArc(10, 50, 100, … | |
Re: [code=java]public class Pong extends JApplet {[/code] quuba | |
Re: [URL="http://penguin.ewu.edu/~trolfe/NaturalMerge/PgmAsg/PgmAsg.html"]http://penguin.ewu.edu/~trolfe/NaturalMerge/PgmAsg/PgmAsg.html[/URL] check and compare quuba | |
Re: [code] add(banner, BorderLayout.NORTH); add(deck, BorderLayout.WEST); add(truck, BorderLayout.CENTER); add(wheel, BorderLayout.EAST); add(extra, BorderLayout.SOUTH); /// adding a window to a container! [/code] redefine Your classes as ... [code] public class ...Panel extends JPanel // NOT JFrame [/code] quuba | |
Re: For internet use Your computer is sufficient. Neither upgrade helps You. Use every week free programs to cleen registry, history...: CCleaner and EasyCleaner. EasyCleaner--> Startup manage programs starting automatically on startup(consult first before delete) .Your desktop should be almost empty.Only MyComputer, Trash, MyNet, MyDocuments, some folders with no big files. … | |
Re: Hello LevelSix. I compress Your program to base size using java.util.LinkedList . It is functional. You can again try to grow it to use own LinkedListIterator,own LinkedList, own Node , function draw(). Some changes: Graphics2D g2 = (Graphics2D) g.create(); in paintComponent(Graphics g) public Dimension getPreferredSize() in LinkedListComponent pack() in LinkedListViewer … | |
Re: record <Collision_ID, exp_1, exp_2> 1.Before adding record to table always partialy sort(exp_1, exp_2) 1a.Check eventualy if(exp_1.equals(exp_2)) 2.Check in table ifExist(Collision_ID, exp_1, exp_2) 3.Add record to table if result is false, if true return info "Collision_ID is redundant" Is need to store in table Collision_ID? ------ n - number of exp … | |
Re: [icode] However, 9 of 10 times it freezes. [/icode] Give us more info, eny error... stack overflow? quuba | |
Re: Hello Vualta. I show You 3 points. 1.Some abstracts about a piece properties, 2.Possible first solution based on array[][] of pieces, 3.Possible second solution based on own class without use of array[][] - with own DATA structue. [B]1.[/B] All of piece have specialy set of geometry properties. Piece can be … | |
Re: [code] System.out.println(anArray[x][y]); [/code] where x,y are selected integer indexes of the anArray. quuba | |
Re: I think, i resolved your old problem.This allow independent highlighting indicated(YELLOW) index and selected indexes(CYAN) without using the focus system. 1) from java doc: javax.swing.DefaultListSelectionModel Added Methods. void moveLeadSelectionIndex( int ), Set the lead selection index, leaving all selection values unchanged. ... 2) defs public static JList anyList; static { … | |
Re: Overwrite method getPreferredSize() in JTextArea: [code] outputArea = new JTextArea() { public Dimension getPreferredSize() { return new Dimension(100, 80); } }; [/code] quuba |
The End.