Search Results

Showing results 1 to 40 of 74
Search took 0.01 seconds.
Search: Posts Made By: quuba
Forum: Java 15 Days Ago
Replies: 3
Views: 451
Posted By quuba
As a random generator use Class java.util.Random. Method nextInt(...
details in docs
java.util.Random r;
int give_me_number_0_49() {
return r.nextInt(49);
}
Forum: Java 15 Days Ago
Replies: 3
Views: 233
Posted By quuba
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.
Forum: Java 19 Days Ago
Replies: 5
Views: 332
Posted By quuba
You gave advice.
Forum: Java 22 Days Ago
Replies: 5
Solved: Blank JFrame
Views: 288
Posted By quuba
Introduce own boolean flag 'pressed' and use it to switch needed behavior
Forum: Java 22 Days Ago
Replies: 5
Views: 312
Posted By quuba
.
.
Forum: Java 22 Days Ago
Replies: 5
Views: 332
Posted By quuba
Your program
// s for string and c for search character
int i = 0;
int result = 0; //number of occurences
for(i = 0; i < s.length(); i++)
{
if (s.charAt(i) == c) //...
Forum: Java 23 Days Ago
Replies: 5
Views: 332
Posted By quuba
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...
Forum: Java 25 Days Ago
Replies: 4
Views: 265
Posted By quuba
http://www.javaworkspace.com/connectdatabase/connectPostgre.do
http://jdbc.postgresql.org/download.html
Forum: Java 25 Days Ago
Replies: 3
Views: 187
Posted By quuba
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...
Forum: Java 25 Days Ago
Replies: 8
Views: 316
Posted By quuba
. check x on input, where x is old
. if x >=0, INPUT never occurs, then x remain forever old >= 0 value
Forum: Java 26 Days Ago
Replies: 3
Views: 241
Posted By quuba
whiteyoh, look at static int ConsoleOptionGUI(String s) method http://www.daniweb.com/forums/thread231390.html
Yet you will not always write all the code in the main method.
Forum: Java 29 Days Ago
Replies: 4
Views: 428
Posted By quuba
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);
Forum: Java Oct 24th, 2009
Replies: 5
Views: 494
Posted By quuba
checkCollision() - method
Imagine, inside dipest loop You want print a dot.
Your loops generates n*n dots.

For size of array=2 , result is 2*2=4 values A,B
AA - the same
AB - ok
BA - compared...
Forum: Java Oct 24th, 2009
Replies: 2
Views: 273
Posted By quuba
1. static method invoke in static form: CLASS . STATIC_METHOD_NAME ( PARAMETERS );
2. static definition of String array: new String[]{"a.wav"} // array length=1
public void test() {
...
Forum: Java Oct 24th, 2009
Replies: 5
Views: 494
Posted By quuba
In place of varible Rectangle r
introduce method

public Rectangle getRectangle() {
return new Rectangle(xCoord, yCoord, Width, Height);
}
or update, while move() r varible

...
Forum: Java Oct 23rd, 2009
Replies: 2
Solved: Jbutton array
Views: 437
Posted By quuba
seats[i] = new JButton(String.valueOf(i + 1));
seats[i].addActionListener(this);

public void actionPerformed(ActionEvent ae){
String text = ((JButton) e.getSource()).getText();
//.....
Forum: Java Oct 20th, 2009
Replies: 3
Views: 525
Posted By quuba
http://java.sun.com/mailers/techtips/corejava/2006/tt0822.html

public void delete(String val) {
current = head.next;
temp = head;
boolean looking = true;
while...
Forum: Java Oct 11th, 2009
Replies: 3
Views: 352
Posted By quuba
for sequence 2MR*2=R*2= ok.

case '=':
resultStr = evaluate();
displayText.setText(resultStr);
numStr1 = resultStr;
...
Forum: Java Oct 10th, 2009
Replies: 5
Views: 382
Posted By quuba
first is OK
String strTemp = JOptionPane.showInputDialog(null, "Please Enter C To Open A Current Account \n Or J To Open A Joint Account");
switch (strTemp.charAt(0)) {
case...
Forum: Java Oct 5th, 2009
Replies: 3
Views: 333
Posted By quuba
for example Line:114
Convert char array to String and then write.
Use String constructor: public String(char[] value)
String s = new String(password);
System.out.println("Password: " + s);
or...
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
In this case

only marked lines are important
where Wins: can be omitted ( always==1 winner)
and Total: can be a another counter, which can be setup to zero ,when the record is saved to a file.
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
If I understand the importance "Wins:". For me, "Wins:" is a player's ID and the number of this identifier is the number of his victories. In that case it would be to determine the number of players...
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
how many variables are needed?
Theoretically
maximum of counter < 20
no more than 20.
20, if randomNumber (always) == 1
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
In place of array you can introduce six int varibles. i0,i1,i2,i3,i4,i5 and use "if" steatment
if(readedInt==0){
i0=i0+1;
}else if (readedInt==1){....
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
due to sequential nature of reading file simpler is introduce array int[5]
int readedInt;
and increase (+1) value at index of array[readedInt]
now array is ready to statistic analysis
Not to...
Forum: Java Sep 27th, 2009
Replies: 28
Views: 1,050
Posted By quuba
Example output is


Reduce redundants ( in write phase )


Now you can know what to do
Forum: Java Sep 27th, 2009
Replies: 2
Views: 283
Posted By quuba
You are declared panelCenter2, but you still add buttons to panelCenter.
Forum: Java Sep 23rd, 2009
Replies: 5
Views: 309
Posted By quuba
Overwrite method public String toString() {... inside class Area.
Forum: Java Sep 23rd, 2009
Replies: 3
Views: 518
Posted By quuba
You are using a different constructor public JLabel(String text)You should use anotherpublic JLabel(Icon image)All instances of ImageIcon keep in the array ImageIcon[] iconArray;
Forum: Java Sep 15th, 2009
Replies: 2
Views: 293
Posted By quuba
via additional ActionListener

public C2() {
c1 = new C1();
add(c1);
c1.addMyListener(new MyAction());
}

private class MyAction implements ActionListener {
Forum: Java Sep 5th, 2009
Replies: 1
Views: 328
Posted By quuba
package demo;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import...
Forum: Java Aug 20th, 2009
Replies: 3
Views: 442
Posted By quuba
String[] splitPath = line.split("\\\\");
Forum: Java Aug 20th, 2009
Replies: 10
Views: 688
Posted By quuba
http://java.sun.com/applets/jdk/1.4/
or with sun jdk install package.
Use also this code in main method

public static void main(String[] args) {
...
Forum: Java Aug 19th, 2009
Replies: 10
Views: 688
Posted By quuba
look at example ...jdk1.6.0_14/demo/applets/GraphLayout/example1.html
the same behavior
Forum: Java Aug 19th, 2009
Replies: 1
Views: 312
Posted By quuba
As start work use this templates

import javax.swing.JApplet;

public class YesNoDialog extends JApplet {

/**
* Initialization method that will be called after the applet is loaded
...
Forum: Java Aug 19th, 2009
Replies: 3
Views: 403
Posted By quuba
Use javax.imageio.ImageIO.read( function,


...
java.lang.String s1 = "IMAGES/Question.gif";
URL url = getClass().getClassLoader().getResource(s1);
try {
...
Forum: Java Aug 18th, 2009
Replies: 10
Views: 688
Posted By quuba
Inside PicturePanel : remove all conditions

//if (e.getSource() == RunProgram.pic1) {/...
or
//if (e.getSource() == RunProgram.pic2) {/...

and by default initilaize eL1 in constructor:
...
Forum: Java Jul 24th, 2009
Replies: 2
Views: 346
Posted By quuba
I working on Windows XP platform, and I am able to get the popup for this JTree.
From api doc java:
public boolean isPopupTrigger()
Note: Popup menus are triggered differently on different...
Forum: Java May 12th, 2009
Replies: 3
Views: 498
Posted By quuba
In Hangman paintComponent(Graphics g)
erase the background first.
Forum: Java Apr 23rd, 2009
Replies: 3
Views: 332
Posted By quuba
Posted code not gives base to conclusion. Cast to String? Which part of code want to do it?
Showing results 1 to 40 of 74

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC