32,199 Topics

Member Avatar for
Member Avatar for ameer.mhmed

how to write code in java this statm if public String pass (){ b =txt_pass.getText(); if ("ameer".equals(b)) JOptionPane.showMessageDialog(null, "the password is correct"); return b; } how to make this **if (user ()) retrun a ** JOptionPane.showMessageDialog(null, "the password is correct");

Member Avatar for stultuske
0
118
Member Avatar for paeez

can any one explain about the below code which is Dining Philosophers Problem.. [CODE] //Dining Philosophers Problem import java.util.Random; class Monitor { int phil_States[] = new int[5]; // 0=not_waiting, 1=waiting // 2=eating boolean fork_States[] = new boolean[5]; // false = in use, true = free Monitor() { // constructor for(int …

Member Avatar for S1nfulAngel
0
1K
Member Avatar for ZixCo

Hi. I am making a program and I started at the first example for sphinx 4. I can't even run the program becouse I get an error:new ConfigurationManager(args [0]) so I can't even run the program. Please help. Here is my code: import java.net.URL; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; import edu.cmu.sphinx.frontend.util.Microphone; …

Member Avatar for JamesCherrill
0
159
Member Avatar for sankubha

how to reduce memory usage of java application...it takes 18 mb memory when started,when i starts new thread it takes 47 mb of memory .After i closed the started thread ,the memory is not reduced to 18 mb. It still stays at 47mb of memory usage.

Member Avatar for masijade
0
438
Member Avatar for thorin

I am getting a very mysterious bug when I run my java website in Browser Mode: IE9 Compatibility View - the sessions stop working and I have no idea why. I don't think there is a tag or any code that I can include in my website that can force …

Member Avatar for thorin
0
616
Member Avatar for Decode098

import javax.swing.JOptionPane; public class Hotel626 extends javax.swing.JFrame { public Hotel626() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jLabel2 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jProgressBar1 = new javax.swing.JProgressBar(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setResizable(false); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Pic/Entrace.jpg"))); // NOI18N jButton1.setBackground(new java.awt.Color(0, 0, …

Member Avatar for stultuske
0
269
Member Avatar for xfinity.Ace

ATM -Deposit -withdraw(5 times maximum per day) -maintaning balance 200 -maximum withrdaw 20,000 -Default Amount 50,000 help me :(

Member Avatar for stultuske
0
192
Member Avatar for SK33

Hello everyone. I have created a class in Java named Farm which contains a list of animals(cow,pig and chick). myFarm is an array of object of Farm class containing objects of NamedCow,pig and chick class. I have not understand one line in my code: NamedCow named = (NamedCow)myFarm.get(0); here what …

Member Avatar for raj.mscking
0
185
Member Avatar for Venku Tur'Mukan

I've recently become interested in trying to adapt my Rock-Paper-Scissors game into a multiplayer-friendly program, so today I decided I'd look up a tutorial on servers. It seems I'm following it precisely (aside from using a different IDE). However, something is going wrong and I'm not sure exactly what it …

0
196
Member Avatar for AbstractEden

Just wanted other opinions on my code and a way to figure out whether or not each number placed into the 2D array is unique. My mind is blanking out a bit, I placed something in the method before but erased it. Debating on whether the parameters should simply be …

Member Avatar for AbstractEden
0
4K
Member Avatar for keithalston

Using the easysoft JDBC-ODBC bridge to connect to an Access DB. Has been working great since CF6. Currently no issues on CF9(solaris). We're working to upgrade our servers to CF10 on Redhat and have everything working except when we attemtp to verify our data sources that use this driver we …

Member Avatar for Proxet
0
409
Member Avatar for bcletseka

i triyed to learnJava programming using netbeans, what kind of a book do you think i can use to be highly educated with programming in java

Member Avatar for Stuugie
0
152
Member Avatar for Wendy_1
Member Avatar for Wendy_1
0
721
Member Avatar for murali2489

Dear All, I have an animal class and a thread class. Just to understamd the concept of Object lock in threads. I have used the Animal instance as a lock in my thread class. The program never ends. My question is is there a condition i can put before invoking …

Member Avatar for JamesCherrill
0
242
Member Avatar for sciprog22

Hello, I am writng a simple networking program with a single server and multiple clients. I would like to send and receive objects between the clients and the server and hence I use the ObjectOutputStream/writeObject(Object) and ObjectInputStream/readObject() combination. First, my server program: import java.net.*; import java.io.*; import java.awt.*; import java.awt.event.*; …

Member Avatar for sciprog22
0
904
Member Avatar for ethan.david.376
Member Avatar for Philippe.Lahaie
0
102
Member Avatar for munchlaxxx

What are some simple games that can be made using linked lists and only java? The simpler, the better

Member Avatar for Philippe.Lahaie
0
83
Member Avatar for Dean_Grobler

Since some of us might get a bit rusty with our coding, we constantly need projects to keep us busy, no matter how big or small. Making sure you code a little a day it not only fun but also allows your skills to continue growning. The problem though, is …

Member Avatar for JamesCherrill
0
751
Member Avatar for Shft

Hello, DaniWeb! Today I am in need of a Java Crash Course! Maybe a couple of (very short) source files with comments describing what things do? Any help is appriciated! I already know C++, how much does that help me?

Member Avatar for JamesCherrill
0
113
Member Avatar for amir4g

Hey everyone, I am learning recursion in Java and I have a lab to do. I have done the first part right, which is to draw those squares. The second part of it is to do the reverse of it, so left starts from the smallest square to biggest. I …

Member Avatar for stultuske
0
963
Member Avatar for Wosh

I have the following list of Integers (0,1,2,3) Now I want to write a method which returns specific number of pairs from the list. So if I give it 5 as argument I will expect it to return the following: (0,1),(1,2),(2,3),(3,0),(0,1) So basically when it reaches the end element and …

Member Avatar for SynThiicQ
0
221
Member Avatar for ganges

My eclipse id is taking too long time to open (at least 15 minutes) I tryed all the options in google search but the problem remains the same kindly give me tips to fix the problem thanks for your time

Member Avatar for ganges
0
4K
Member Avatar for Raquel_2

// random number generator var theDecimal = 0; function newProblem(){ theDecimal = Math.floor(Math.random()*256); //math.floor chops off decimals and rounds document.getElementById("startNumber").innerHTML = theDecimal; }

Member Avatar for Schol-R-LEA
0
254
Member Avatar for pwolf

As a beginner java learner, I would be grateful if some people could point out a few open source projects with a high quality code base. Not necceserily aimed at a beginner, I would rather see a professional quality example, and preferabbly the project would use some common tools for …

Member Avatar for pwolf
0
477
Member Avatar for hillary.vitzthum

I have already seen that someone posted this question a couple of years ago. I do not want any one to flat out give me the answer. I hav the code written, I just cannot figure out why the pattern won't look like this: 1 12 123 1234 12345 123456 …

Member Avatar for hvitzthum
0
111
Member Avatar for Rajveer456
Member Avatar for Sifiso21031085
Member Avatar for Sifiso21031085
0
90
Member Avatar for Rajveer456

Guys visit this site and please let me know what are the disadvantages of this website ....i am the new user..... **www.bjavaexpert.com**

Member Avatar for stultuske
0
118
Member Avatar for C

I had a programme to write for college in Java. I have missed the class so I won't be getting marked on it but wanted to get it done as I have an exam next we. I am really stuck. I have to create a costInsurance () method taking in …

Member Avatar for C
0
323
Member Avatar for murali2489

Hi All, I came across this question in Cathy Siera SCJP book and the answer is really Strange and i dont understand. The question is below. class A { } class B extends A { } public class Comingthru { static String s ="-"; public static void main(String[] args) { …

Member Avatar for murali2489
0
183

The End.