388 Posted Topics
Re: use :[QUOTE]JScrollPane scrollPane; //do not mix swing with awt ScrollPane scrollPane.setWheelScrollingEnabled(true);//usefull method[/QUOTE] about JScrollPane read in java tutorial | |
Re: Same way as you created aliens, check intersect with a laser for each alien. Here is only one line of code, the rest you need write. [QUOTE]aliens[j][k] = new Alien(0, 0, 0, 0, 0, 0);[/QUOTE] | |
Re: Fast exponentiation algorithm: [URL="http://pl.wikipedia.org/wiki/Algorytm_szybkiego_potęgowania"]http://pl.wikipedia.org/wiki/Algorytm_szybkiego_potęgowania[/URL] and lines 27-31 you can replace by [QUOTE]return left.equals(right);[/QUOTE] | |
Re: Factorial is one argument operator, result is ready immediately. Summation - no. You need to define the end of sum operation | |
Re: Lines 54,55 second declaration of the same fields covers previous declarations. | |
Re: First post Line 19 [CODE]private JTextField contestant, scr, s1, s2, s3, s4, s5, s6, s7, s8, s9;[/CODE] fields s1, s2, s3, s4, s5, s6, s7, s8, s9 are null. Where are new, new, new...... instances of them? | |
Re: [URL="http://java.sun.com/javase/6/docs/api/javax/swing/package-summary.html#threading"]http://java.sun.com/javase/6/docs/api/javax/swing/package-summary.html#threading[/URL] Swing threading and the event-dispatch thread [URL="http://www.javaworld.com/javaworld/jw-08-2007/jw-08-swingthreading.html?page=1"]http://www.javaworld.com/javaworld/jw-08-2007/jw-08-swingthreading.html?page=1[/URL] | |
Re: bibiki use Runnable interface with method run() , an start new Thread [CODE=java]import javax.swing.*; import java.awt.*; public class Bully extends JPanel implements Runnable { private Testi aa; private Tooopi bb; public Bully() { JFrame korniza = new JFrame(); korniza.getContentPane().add(this); korniza.setSize(500, 500); korniza.setTitle("Bull's Eye"); korniza.setVisible(true); korniza.setDefaultCloseOperation(3); aa = new Testi(); bb … | |
Re: Do it with and without toString() method [CODE=java] import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { List<Any> list = new ArrayList<Any>(); list.add(new Any(1)); list.add(new Any(2)); System.out.println(list); } } class Any { private final int i; public Any(int i) { this.i = i; } public … | |
Re: Find first better place for JOptionPanes then paint method. | |
Re: JRadioButton is a one bit two state memory. [QUOTE] JRadioButton autoRedButton; JRadioButton autoYellowButton; [/QUOTE] to check state simply write [QUOTE] boolean stateOfAutoRedButton =autoRedButton.isSelected(); [/QUOTE] [CODE=java] public class Connect4View extends JFrame { DrawPanel canvas; Connect4Model model; ControlPanel myControlPanel; public Connect4View() { setTitle("Connect4 solution"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(500, 220); setLocation(300, 300); int number_of_columns = … | |
Re: Post absent classes. ...Check.java:21: cannot find symbol super(tId, tAmt, tCount); symbol: constructor Transaction(int,double,int) location: class Transaction where public Check(int tId, double tAmt, int tCount, int checkNumber) { public Transaction(int num, int id, double amt) { | |
Re: idiom: [CODE=java]public enum Roles { KING, SLAVE, OBSERVER, NOTHING } [/CODE] real representation [CODE=java]// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 2010-04-23 22:51:41 // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) fieldsfirst nonlb // Source File Name: Roles.java public final class … | |
Re: probably [B]EDT[/B] problem swing is not thread safe! [URL="http://mindprod.com/jgloss/swingthreads.html"]http://mindprod.com/jgloss/swingthreads.html[/URL] | |
Re: pack result in the double array the same way as does the method: [CODE]this.Portion(times);[/CODE] | |
Re: look at "adatapost" example [URL="http://www.daniweb.com/forums/post979382.html#post979382"]http://www.daniweb.com/forums/post979382.html#post979382[/URL] | |
Re: [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html"]http://java.sun.com/docs/books/tutorial/uiswing/components/table.html[/URL] ColorRenderer.java | |
Re: [CODE=java] import java.util.ArrayList; import java.util.List; public class CinemaExample { public static void main(String[] args) { List<Cinema> cinemas = new ArrayList<Cinema>(); // fill the cinemaList Cinema cinema1 = new Cinema("Paradise"); cinemas.add(cinema1); Cinema cinema2 = new Cinema("Zodiac"); cinemas.add(cinema2); Movie movie1 = new Movie("Zorro"); Movie movie2 = new Movie("Titanic"); Movie movie3 = new … | |
Re: hello softdev public class BottomLaneCar extends Car public class UpperLaneCar extends Car local varibles x,y HIDES same fields of class Car change this | |
Re: Hello, [QUOTE=veerasek;760650]Hello, Please look into the following coding for converting HTML into XML. My Java Program [code=java] // line 44. XMLOutputter outputter = new XMLOutputter(); [/code][/QUOTE] I wrote a piece of code with regard to encoding: Result: run: [code=xml] <?xml version="1.0" encoding="iso-8859-2"?> <html> <body> <h1>Second Page</h1> <input type="text" name="name" value="Veera" … | |
Re: Hidden advertorial. How can I help you in your business? | |
Re: Show your typeof_patronJComboBox model. Post more code ... as attachment (for example). Line 9 is on the first look looks is on its way a strange. | |
Re: As a random generator use Class java.util.Random. Method nextInt(... details in docs [CODE]java.util.Random r; int give_me_number_0_49() { return r.nextInt(49); }[/CODE] | |
Re: in Product class made public method [QUOTE] getID(){ return id;}[/QUOTE] with proper return type, and use in place of [QUOTE]searchProduct.id[/QUOTE] [QUOTE]if(item.getID() == searchProduct.getID())[/QUOTE] | |
Re: You've written a program to count the specific character given c. This character may also be a space. How much can be different characters in your text? Each character has its representation as an integer. Create an array of sufficient numbers of cells, and then in a single loop process, … | |
Re: Introduce own boolean flag 'pressed' and use it to switch needed behavior | |
Re: Write new class [QUOTE]MorseEncoder[/QUOTE] Place in it your array [QUOTE] String[] morse[/QUOTE] Start from single char. Get result. Later use array of char or String. // Alternatively you can do all work inside single static method. | |
Re: write the method [QUOTE] boolean contanis(int i)[/QUOTE] in this method loop around the array, if value associated with current loop-index is equal to i-value return true... | |
Re: Do not forget also the [QUOTE]Node root[/QUOTE] | |
Re: . check x on input, where x is old . if x >=0, INPUT never occurs, then x remain forever old >= 0 value | |
Re: [QUOTE]add(new JLabel(card1));[/QUOTE] use varibles for labels first declare in proper place: JLabel label1; In constructor create new instance of label: label1 = new JLabel(card1); add this label ... /// In method actionPerformed your labels stays avilable to set new icons | |
Re: [URL="http://www.javaworkspace.com/connectdatabase/connectPostgre.do"]http://www.javaworkspace.com/connectdatabase/connectPostgre.do[/URL] [URL="http://jdbc.postgresql.org/download.html"]http://jdbc.postgresql.org/download.html[/URL] | |
Re: Nothing to change. This form is fully acceptable. -------- You can try CardLayout; on each tab, you can put only the necessary components labels and txtfields, and switch between tabs in accordance with the choice, but it still requires additional changes in code. | |
Re: properly write constructor reply , what does mean parameter "String in" in contructor? What information is transmitted to a class? | |
Re: whiteyoh, look at static int ConsoleOptionGUI(String s) method [URL="http://www.daniweb.com/forums/thread231390.html"]http://www.daniweb.com/forums/thread231390.html[/URL] Yet you will not always write all the code in the main method. | |
Re: Look at java doc java.util.Calendar and java.util.GregorianCalendar classes. Nice implemented interfaces, constructors and methods. Nice examples. Their use will reduce drastically the volume of code. Most of Date methods are deprecated. | |
Re: [CODE]System.exit(0);[/CODE] comment this, it closes all windows and ends program find another solution e.g. setting the status window on the invisible | |
Re: [QUOTE]Thank you, but it doesn't solve my problem [/QUOTE] On a very general question, do not expect a detailed response The same url as peter_budo posted [URL="http://chumbalum.swissquake.ch/files/MS3DHelp-HTML.zip"]http://chumbalum.swissquake.ch/files/MS3DHelp-HTML.zip[/URL] [QUOTE]MilkShape 3D supports a wide range of 3D and bitmap image formats. User made plug-ins allow support for files that users wish to … | |
Re: Active Rendering [URL="http://www.gamedev.net/reference/programming/features/javarender/default.asp"]http://www.gamedev.net/reference/programming/features/javarender/default.asp[/URL] Thread Pools [URL="http://www.brackeen.com/javagamebook/"]http://www.brackeen.com/javagamebook/[/URL] Threads [URL="http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html"]http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html[/URL] | |
Re: You are working with package qtjambi. You should know it better. first read [URL="http://doc.trolltech.com/qtjambi-4.5.2_01/index.html"]http://doc.trolltech.com/qtjambi-4.5.2_01/index.html[/URL] [URL="http://doc.trolltech.com/qtjambi-4.5.2_01/com/trolltech/qt/gui/QPlainTextEdit.html"]http://doc.trolltech.com/qtjambi-4.5.2_01/com/trolltech/qt/gui/QPlainTextEdit.html[/URL] select proper method from QPlainTextEdit to apply textEdit.document() in CodeEditor constructor | |
Re: Learn first [URL="http://www.brpreiss.com/books/opus5/"]http://www.brpreiss.com/books/opus5/[/URL] | |
Re: Add field [QUOTE]Image image;[/QUOTE] in Room . Extend the Room constructor , or write the new one, which takes into account a new parameter, image. If you dane this, look [QUOTE]setExit(String direction, Room neighbor)[/QUOTE] Each neighbor already has its own image! // Good idea is overwrite method [QUOTE]public String toString()[/QUOTE] … | |
Re: Decide, that you need single Frame. If yes, create class MyLinkPanel extends JPanel in same way as class MyPanel. Inside constructor MyFrame() add new instance of MyLinkPanel in same way as instance of MyPanel. | |
Re: [URL="http://www.brpreiss.com/books/opus5/html/page264.html"]http://www.brpreiss.com/books/opus5/html/page264.html[/URL] | |
Re: public class GCD have a static method gdc. Then you do not need to create new instance of this class . simply use long val = GDC.gdc(l1,l2); | |
Re: 1. to generate random index, use public int nextInt(int n) method from java.util.Random, where n is number of questions. 2. introduce int varibles counters for correct and wrong answer. Check quest_no, and print results if is equal 10. | |
Re: [QUOTE]Construct three TrafficLight objects named:light1,light2,light3[/QUOTE] this mean [QUOTE]TrafficLight light1 = new TrafficLight(); TrafficLight light2 = new TrafficLight(); TrafficLight light3 = new TrafficLight(); [/QUOTE] use methods to setColor green,yellow,red ;getColor |
The End.