388 Posted Topics

Member Avatar for shakssage

It depends on the layout. What is layot of panel? //add the slider to the panel In which layouts the .setLocation-method is effective?

Member Avatar for shakssage
0
844
Member Avatar for cool_jatish

[URL="http://mindprod.com/jgloss/codepoint.html"]http://mindprod.com/jgloss/codepoint.html[/URL] Look at the post:[URL="http://www.daniweb.com/forums/thread179741-2.html"]http://www.daniweb.com/forums/thread179741-2.html[/URL] and my utility DetectUnicodeBlocks.class

Member Avatar for quuba
0
194
Member Avatar for gedas

1. create new instance of ArrayList java.util.List<String> anList = new java.util.ArrayList<String>(); 2. add names to anList 3. convert anList to Object[] anArray: Object[] model = anList.toArray(); 4. create new instance of JList jList: jList = new JList(model); 5. read [URL="http://download.oracle.com/javase/tutorial/uiswing/components/list.html"]http://download.oracle.com/javase/tutorial/uiswing/components/list.html[/URL]

Member Avatar for quuba
0
230
Member Avatar for pigmario

Inside hexagon is "i=20". You interpret this as while(i<a){} loop. OK, I can consider with this assumption. [QUOTE]i dont know if it is true, i dont understand for the first if if its false how i want to proceed it?? can anyone tell me how the first if must be …

Member Avatar for febrilian samo'
0
742
Member Avatar for cielle

minim package: based on ForwardFFT.pde example jingle = minim.loadFile("jingle.mp3", 2048); in this case bufferSize = 2048 and this size is also a size of Hamming window look at sources

Member Avatar for quuba
0
1K
Member Avatar for seanbp

I like this! 2+2*2=6 OK (typical test for calculators) -5+1 NO -5 NO 5=5 OK (-5)+1 NO 1+(-5) NO +5 NO Wrong work with the sign of number (+-) (distinction between the operator and the sign) Program should show the first wrong positions in the input chain

Member Avatar for seanbp
1
1K
Member Avatar for raghavp
Member Avatar for Akill10
Member Avatar for rational_

Here are two your methods simplified for testing purposes (without conditions) [CODE] public void paintVertically(Graphics gc) { int i0 = 0; int j0 = 0; for (int i = 0; i < 5; i++) { for (int j = 0; j < 4; j++) { gc.setColor(Color.blue); gc.drawLine(dots[i0][j0].x, dots[i0][j0].y, dots[i][j].x, dots[i][j].y); …

Member Avatar for quuba
0
181
Member Avatar for fenerista

1. when MouseEvent fires mousePressed(MouseEvent e) then get/append[CODE] Transferable trans = clipboard.getContents(null); String s1 = (String) trans.getTransferData(DataFlavor.stringFlavor); if (s1.equals(s)) { //nothing to do (avoid populate text in editor) //an alternative to clipboard clear (?) } else { TextEditor.editor.append(Color.red, s); s = s1; // store to compare }[/CODE] where in my …

Member Avatar for fenerista
0
3K
Member Avatar for hashim11

class reserveform extends JFrame implements ---???----{ - Which one interface implements?

Member Avatar for quuba
0
146
Member Avatar for Akill10

It seems that the use of the keyboard (missiles) affects the acceleration of foreign traffic. You can use your own game clock and sync with it. I recommend the book: [URL="http://www.brackeen.com/javagamebook/"]http://www.brackeen.com/javagamebook/[/URL] // With acceleration, the game also looks good and does not indicate an error, but a covert intelligence of …

Member Avatar for Akill10
0
127
Member Avatar for SerogaM
Member Avatar for jamesl22
Member Avatar for LianaN

Look at standard java \jdk1.7.0\demo\applets\GraphLayout folder used variables: - boolean pickfixed; - int numMouseButtonsDown; and methods: - removeMouseMotionListener(this); - addMouseMotionListener(this); or alternatively in place of clicked use left and right button (with key modifiers) what is mouseClicked? mousePressed mouseReleased mousePressed mouseReleased Test this on simple mouse program similar to line …

Member Avatar for LianaN
0
426
Member Avatar for Akill10

method get() load images from files to Image[] array - used once method set() gets images from Image[] array - used many times Show your getSpaceShipSprite() method.

Member Avatar for Akill10
0
178
Member Avatar for ethio

Hello ethio Look at the example: [URL="http://download.oracle.com/javase/tutorial/uiswing/examples/misc/InputVerificationDialogDemoProject/src/misc/InputVerificationDialogDemo.java"]http://download.oracle.com/javase/tutorial/uiswing/examples/misc/InputVerificationDialogDemoProject/src/misc/InputVerificationDialogDemo.java[/URL] Use this example as a pattern to work. Particularly start your application in same way. You can copy as a whole two methods: public static void main(String[] args) private static void createAndShowGUI() In the last method change only name InputVerificationDialogDemo to Password. Your …

Member Avatar for quuba
0
124
Member Avatar for JellyTurf

[URL="http://download.oracle.com/javase/tutorial/uiswing/components/icon.html"]http://download.oracle.com/javase/tutorial/uiswing/components/icon.html[/URL] [URL="http://download.oracle.com/javase/tutorial/2d/images/loadimage.html"]http://download.oracle.com/javase/tutorial/2d/images/loadimage.html[/URL] [QUOTE]If you are writing a real-world application, it is likely (and recommended) that you put your files into a package.[/QUOTE]

Member Avatar for ProgrammerAl
0
266
Member Avatar for ll_jesse_ll
Member Avatar for baldwindc

[CODE]public class Flight { private final String name; private final int id; Flight(String name, int id) { this.name = name; this.id = id; } String getName() { return name; } int getId() { return id; } String getFullName() { return name + id; } }[/CODE] [CODE]public class FlightSet { private …

Member Avatar for baldwindc
0
358
Member Avatar for Lazairus

yes [URL="http://download.oracle.com/javase/tutorial/uiswing/components/icon.html"]http://download.oracle.com/javase/tutorial/uiswing/components/icon.html[/URL] [URL="http://download.oracle.com/javase/tutorial/2d/images/loadimage.html"]http://download.oracle.com/javase/tutorial/2d/images/loadimage.html[/URL] AWT Label, keys operate, thread based application example: [URL="http://www.daniweb.com/forums/thread331227.html"]http://www.daniweb.com/forums/thread331227.html[/URL] You can base on javax.swing.Timer or javax.swing.SwingWorker<T,V>. Look at api doc (examples inside).

Member Avatar for quuba
0
87
Member Avatar for ronnieaka

with Anonymous Inner Class Runnable [CODE]import java.awt.*; import java.awt.event.*; class Snake extends Frame implements KeyListener {//ActionListener Thread t = new Thread(); String s = "####";//my snake, String sc = "";//for storing score int score = 0; int dir = 0; int kt; int x, y;//position variables for snake label Label …

Member Avatar for quuba
0
325
Member Avatar for Java_90

If it is a Swing applicaction here is an example: [URL="http://download.oracle.com/javase/tutorial/uiswing/examples/misc/InputVerificationDialogDemoProject/src/misc/InputVerificationDialogDemo.java"]http://download.oracle.com/javase/tutorial/uiswing/examples/misc/InputVerificationDialogDemoProject/src/misc/InputVerificationDialogDemo.java[/URL]

Member Avatar for quuba
0
94
Member Avatar for Dragon55544

There are two solutions; 1. class Female extends Student class Male extends Student abstract class Student 2. class Female implements Student class Male implements Student interface Student Both methods allows you to write: [CODE] public static void main(String args[]) { Student[] studentArray = new Student[2]; studentArray[0] = new Male(22, 6); …

Member Avatar for quuba
0
87
Member Avatar for kondeti ramesh

Missing Arithmetic Multiplication operator [URL="http://download.oracle.com/javase/tutorial/java/nutsandbolts/opsummary.html"]http://download.oracle.com/javase/tutorial/java/nutsandbolts/opsummary.html[/URL]

Member Avatar for quuba
0
86
Member Avatar for vilas_tadoori
Member Avatar for LianaN

I propose to create a new class to work with SQL (from class QueryTableModel move part of sql code) [CODE]DataBase db = new DataBase(url, databasename, login, pass);[/CODE] each query returns "new table model" [CODE]QueryTableModel qtm = db.setQuery(String q)[/CODE] method setQuery(String q) should return [CODE] public QueryTableModel setQuery(String q) { //... …

Member Avatar for quuba
0
591
Member Avatar for cielle

1. download sources 2. create nb new project 3. put com folder to nb src folder 4. download [URL="http://www.jfugue.org/jfugue-chapter1.pdf"]http://www.jfugue.org/jfugue-chapter1.pdf[/URL] 5. run a Test Program from 4. 6. with sources, docs, examples you can answer your questions Look at the methods in org.jfugue.Player class.

Member Avatar for cielle
0
276
Member Avatar for Dani

daniweb.com, - position in the world: (HIGH) 1 238 - visits per day (average, last 90 days) 285 690 ... more details on the website [URL="http://bizinformacja.pl/www.daniweb.com"]http://bizinformacja.pl/www.daniweb.com[/URL] ------------------------------------------ kvggdf.com [91.213.217.191] tried to attack? my computer

Member Avatar for peter_budo
3
675
Member Avatar for aanders5

Imagine, that you have only one line to read from text file. Write a java console program with the following assumptions: Open and read text file with fixed name. Parse values to 6 Local Variables (of String or Double types) Report on screen. Variables,Naming [URL="http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html"]http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html[/URL] ... Create new class ie. …

Member Avatar for aanders5
0
217
Member Avatar for lotrsimp12345

Implement MouseListener in class MyPanel. [URL="http://download.oracle.com/javase/tutorial/uiswing/events/mouselistener.html"]http://download.oracle.com/javase/tutorial/uiswing/events/mouselistener.html[/URL] Inside mouse methods use e.getPoint() where e is a MouseEvent // You have two JFrames: Line 15 and Line 32 ?

Member Avatar for quuba
0
266
Member Avatar for mangeshminal

[B]testcaseValues[/B] always indicate the same object. Final effect you can see. In the line 26 you should create new object Put line 14 in place of line 26

Member Avatar for quuba
0
103
Member Avatar for Slyvr

set layout for JFrame for example: [CODE] //GUI JFrame frame = new JFrame("Biz Sim"); frame.setLayout(new GridLayout(1,0));[/CODE] for JFrame default layout is: [CODE] System.out.println(frame.getLayout());[/CODE] java.awt.BorderLayout[hgap=0,vgap=0]

Member Avatar for Eric Cute
0
180
Member Avatar for Theformand
Member Avatar for ndkv

Write first CustomerInfo program without GUI with the input data as in your example 24 roses TOTAL= 1 bear TOTAL= 14 Lilies TOTAL=

Member Avatar for quuba
0
1K
Member Avatar for nitins60

[CODE] public void Customer(String name, PaymentType paymentType) { //select which paymentType he opted switch (paymentType) { case CHEQUE: // enumeration constant, wrong is use PaymentType.CHEQUE // break; case CREDITCARD: // break; case CASH: // break; } }[/CODE] The Java Tutorials is your first book! [URL="http://download.oracle.com/javase/tutorial/java/javaOO/enum.html"]http://download.oracle.com/javase/tutorial/java/javaOO/enum.html[/URL]

Member Avatar for quuba
0
107
Member Avatar for adams161

java -cp "_your class path,place where folder org is_" org.newdawn.spaceinvaders.Game

Member Avatar for adams161
0
95
Member Avatar for ajst
Member Avatar for JamesCherrill
0
3K
Member Avatar for LianaN

Experimental look - not tested use getPreferredSize, then setPreferredSize [CODE]private JTextField[] txtAttrTextFields = new JTextField[NrOfTextFields]; { for (int i = 0; i < NrOfTextFields; i++) { // int i can't be final txtAttrTextFields[i] = new JTextField(){ @Override public Dimension getPreferredSize() { // return new Dimension((10+10*Integer.valueOf(getName())),40); return new Dimension(table.getColumn(attrTitle.elementAt(Integer.valueOf(getName())).toString()).getPreferredWidth(), 40); //no …

Member Avatar for quuba
0
124
Member Avatar for Tankadin

unreported exception java.lang.Exception; TWO WAYS must be caught //handling error in place -->[CODE] else { try { throw new Exception(); } catch (Exception ex) { // here your reaction on error } }[/CODE] or declared to be thrown. add throws clause: [CODE] public void setRectangle(int initialX, int initialY, int initialWidth, …

Member Avatar for quuba
0
430
Member Avatar for LianaN

The Event Dispatch Thread [URL="http://mindprod.com/jgloss/swingthreads.html"]http://mindprod.com/jgloss/swingthreads.html[/URL] [URL="http://download.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html"]http://download.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html[/URL]

Member Avatar for quuba
0
225
Member Avatar for LianaN

Apply to your JTable method: [CODE] jotTable.setFillsViewportHeight(true);[/CODE] Your method should look typically: [CODE]public Object getValueAt(int row, int col) { return ((Object[]) cache.elementAt(row))[col]; }[/CODE] Use DefaultTableCellRenderer Here is an example. [CODE]DefaultTableCellRenderer LPRenderer = new DefaultTableCellRenderer() { @Override public void setValue(Object value) { int cellValue = (value instanceof Number) ? ((Number) value).intValue() …

Member Avatar for quuba
0
1K
Member Avatar for crisabraham
Member Avatar for frankel81

this mean: YOU should first create the array with the initial employees’ salaries and then update the salaries to show the 30% increase Read Me: Starting "Java" [Java tutorials / resources / faq] - first thread on the page

Member Avatar for plasticfood
0
153
Member Avatar for TahoeSands

java doc. Interface java.awt.LayoutManager defaults: 1. javax.swing.JRootPane$1[hgap=0,vgap=0] 2. java.awt.FlowLayout[hgap=5,vgap=5,align=center]

Member Avatar for Gerbiler
0
214
Member Avatar for jems5
Member Avatar for Melow
Member Avatar for Melow
0
175
Member Avatar for atticusMom

I simplified class names ( too long for me ) Write new classes from scratch, only that, that you need to run execute this main() line by line and show your results [CODE] public static void main(String args[]) { // at any phase write only, what things you need //write …

Member Avatar for quuba
0
340
Member Avatar for Kremlan

line: Color newColor = new Color(r / count, g / count, b / count); introduces rounding error for each color component A faster algorithm uses this line two times (rows and columns separately) for smaller number of cells to compute and introduces cumulative rounding error (two roundings) [side effect of …

Member Avatar for quuba
0
148
Member Avatar for blknmld69

The End.