388 Posted Topics

Member Avatar for IOwnAndPwnU

use :[QUOTE]JScrollPane scrollPane; //do not mix swing with awt ScrollPane scrollPane.setWheelScrollingEnabled(true);//usefull method[/QUOTE] about JScrollPane read in java tutorial

Member Avatar for quuba
0
114
Member Avatar for runee1000

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]

Member Avatar for quuba
0
880
Member Avatar for miotvsingtel

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]

Member Avatar for quuba
0
278
Member Avatar for skiracer

Factorial is one argument operator, result is ready immediately. Summation - no. You need to define the end of sum operation

Member Avatar for mozly
0
74
Member Avatar for BobbieJean
Member Avatar for quuba
0
109
Member Avatar for gradstud

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?

Member Avatar for gradstud
0
323
Member Avatar for sbrown2594

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

Member Avatar for quuba
0
721
Member Avatar for back2grave
Member Avatar for bibiki

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 …

Member Avatar for quuba
0
197
Member Avatar for DGXI

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 …

Member Avatar for moutanna
0
90
Member Avatar for pateldeep454
Member Avatar for quuba
0
111
Member Avatar for ku95

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

Member Avatar for quuba
0
107
Member Avatar for sho12345

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

Member Avatar for sho12345
0
100
Member Avatar for elSifa

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 …

Member Avatar for quuba
0
2K
Member Avatar for InsaneOstrich

probably [B]EDT[/B] problem swing is not thread safe! [URL="http://mindprod.com/jgloss/swingthreads.html"]http://mindprod.com/jgloss/swingthreads.html[/URL]

Member Avatar for InsaneOstrich
0
555
Member Avatar for sweetgurl

pack result in the double array the same way as does the method: [CODE]this.Portion(times);[/CODE]

Member Avatar for sweetgurl
0
87
Member Avatar for white feather

look at "adatapost" example [URL="http://www.daniweb.com/forums/post979382.html#post979382"]http://www.daniweb.com/forums/post979382.html#post979382[/URL]

Member Avatar for white feather
0
83
Member Avatar for Nirupams

[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

Member Avatar for moutanna
0
143
Member Avatar for Fulladder

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

Member Avatar for quuba
0
3K
Member Avatar for softdev

hello softdev public class BottomLaneCar extends Car public class UpperLaneCar extends Car local varibles x,y HIDES same fields of class Car change this

Member Avatar for quuba
0
106
Member Avatar for veerasek

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

Member Avatar for ~s.o.s~
0
6K
Member Avatar for Devoted Hosting
Member Avatar for kettavan

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.

Member Avatar for kettavan
0
87
Member Avatar for starlight09

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]

Member Avatar for starlight09
0
621
Member Avatar for ladybritt

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]

Member Avatar for quuba
0
67
Member Avatar for snehula

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

Member Avatar for quuba
0
134
Member Avatar for babylonlion

Introduce own boolean flag 'pressed' and use it to switch needed behavior

Member Avatar for babylonlion
0
174
Member Avatar for babylonlion
Member Avatar for _dragonwolf_

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.

Member Avatar for _dragonwolf_
0
243
Member Avatar for 2Mas

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

Member Avatar for quuba
0
107
Member Avatar for iamsmooth
Member Avatar for tom.t

. check x on input, where x is old . if x >=0, INPUT never occurs, then x remain forever old >= 0 value

Member Avatar for tom.t
0
130
Member Avatar for geek_till_itMHZ

[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

Member Avatar for Ezzaral
0
163
Member Avatar for jakx12

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

Member Avatar for masijade
0
528
Member Avatar for jko2326

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.

Member Avatar for jko2326
0
144
Member Avatar for MoooCow

properly write constructor reply , what does mean parameter "String in" in contructor? What information is transmitted to a class?

Member Avatar for quuba
0
143
Member Avatar for Samyx
Member Avatar for whiteyoh

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.

Member Avatar for whiteyoh
0
119
Member Avatar for bkafroboy69

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.

Member Avatar for quuba
-1
146
Member Avatar for Mykd

[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

Member Avatar for quuba
0
96
Member Avatar for ~mesho~

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

Member Avatar for quuba
0
74
Member Avatar for swinefish

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]

Member Avatar for quuba
0
294
Member Avatar for kjiu

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

Member Avatar for kjiu
0
237
Member Avatar for sun26

Learn first [URL="http://www.brpreiss.com/books/opus5/"]http://www.brpreiss.com/books/opus5/[/URL]

Member Avatar for quuba
0
81
Member Avatar for Blondeamon

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

Member Avatar for quuba
0
133
Member Avatar for Sandar Khin

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.

Member Avatar for quuba
0
134
Member Avatar for TigerGirl

[URL="http://www.brpreiss.com/books/opus5/html/page264.html"]http://www.brpreiss.com/books/opus5/html/page264.html[/URL]

Member Avatar for TigerGirl
0
66
Member Avatar for prelyptica

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

Member Avatar for thines01
0
194
Member Avatar for junglee

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.

Member Avatar for quuba
0
299
Member Avatar for bennettgirl99

[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

Member Avatar for quuba
0
157

The End.