36,051 Topics

Member Avatar for
Member Avatar for Wendy_1
Member Avatar for Wendy_1
0
724
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
244
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
907
Member Avatar for ethan.david.376
Member Avatar for Philippe.Lahaie
0
105
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
758
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
119
Member Avatar for mateusz.baran1

what iam trying to do is get field parameter and run mysql query to update(decrement) value from field quantity, can any one tell me how to do that? <form method="post"> <table class="bordered"> <thead> <tr> <th>No</th> <th>Drug Name</th> <th>Strength</th> <th>Quantity</th> <th>Dis Qty</th> </tr> </thead> <% try { String query="select * from …

Member Avatar for stultuske
0
185
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
982
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
224
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
259
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
482
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
112
Member Avatar for Muni123

I have a login jsp page where users can login in to my web application, I have also a sign Up form where user can register if they are not members. I'm trying to do the login and sign up forms in one JSP called login.jsp. Login part works fine …

Member Avatar for ckide
0
2K
Member Avatar for Rajveer456
Member Avatar for Sifiso21031085
Member Avatar for Sifiso21031085
0
93
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
121
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
324
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
186
Member Avatar for sara12234
Member Avatar for ckide
0
324
Member Avatar for ParPau

Having issues with array. Seems to pull in the enum files (month and average rainfall) and print accordingly. Also seems to read in the updated rainfall per month. However, problem is I can not make updated print with the enum. Also, last line in program has ..."actual[i]". If use a …

Member Avatar for ParPau
0
280
Member Avatar for firepower

how do i change the background to a custom one. code JButton button = new JButton(); JButton quit = new JButton(); public Mainmenu() { Icon b = new ImageIcon(getClass().getResource("play.jpg")); play = new JButton(playb); add(button,BorderLayout.CENTER); Icon quitb = new ImageIcon(getClass().getResource("quit.jpg")); quit = new JButton(quitb); add(quit,BorderLayout.SOUTH); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent …

Member Avatar for JamesCherrill
0
210
Member Avatar for V3N0M

I just started learning Java and I have been playing around with it. I am trying to make this program return a double value like 1000/3 = 333.33333..... but it returns 333.000 what am I doing wrong in Java. It works in C though :P. Thanks in Advance! //Exercise : …

Member Avatar for JamesCherrill
0
210
Member Avatar for gyno

public class arraChange { public static void main(String []args){ int arr [] = {2,3,4,5,6,7,8}; public class arrayCounter { public static void main(String args []){ Random rand = new Random(); int freq[] = new int [7]; considering the above two seperate lines of codes, i just want people to explain to …

Member Avatar for JamesCherrill
0
142
Member Avatar for firepower

please help me how to close the window. code: JButton quit = new JButton(); public Mainmenu() { setLayout(new FlowLayout()); Icon quitb = new ImageIcon(getClass().getResource("quit.jpg")); quit = new JButton(quitb); add(quit); quit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } });

Member Avatar for mKorbel
0
166
Member Avatar for sankubha

I need to get printed documents name and from which ip it is printed using java.

Member Avatar for sankubha
0
221
Member Avatar for Pavan_5

I am trying to develop the genetic algorithm to solve Traveling Saleman problem and part of my challenge is to generate random tours long enough and write a fitness function to evaluate the cost incurred for each of the random tour. I have attempted to write the following. My objective …

Member Avatar for JamesCherrill
0
429
Member Avatar for Nimalshi

For example, How do I use this custom print method to display something in the main method? public static void print(Stack<String> myStack ) { int count = 1, sizeOfStack = myStack.size(); System.out.println("\nYour stack has size: " + myStack.size()); for (String myString : myStack) {System.out.print(count + ". " + myString); if(count!=sizeOfStack) …

Member Avatar for JamesCherrill
0
227
Member Avatar for Mr.M

Hi Dw I've recently created an application in java on this post:www.daniweb.com/software-development/java/threads/458306/how-to-work-with-jpos and now I just want to improve this by enabling a feature of mixing the cash notes when dispensing the required amount. The machine has these bills notes: 10, 20, 50, 100, and 200 so now what I …

Member Avatar for JamesCherrill
0
145
Member Avatar for Nimalshi

I'm writing this code for one of my projects. can you please help me with line #6,#7 and #10? I'm not sure if I am writing the code for those correctly. package waffles; import java.util.Scanner; import java.util.Stack; /** * */ public class Waffles { /** * @param args the command …

Member Avatar for Schol-R-LEA
0
162
Member Avatar for MatthewYeend

package die.java; import java.util.Random; class DieGame2 { private final int sides; private final Random generator = new Random(); public DieGame2(int s) { sides = s; } public boolean throwDie() { int faceValue = generator.nextInt(sides) + 1; System.out.print(faceValue); return faceValue == 6; } public static void main(String[] args) { DieGame die1 …

Member Avatar for stultuske
0
346
Member Avatar for Muni123

I have a login jsp page where users can login in to my web application, I have also a sign Up form where user can register if they are not members. I'm trying to do the login and sign up forms in one JSP called login.jsp. Login part works fine …

Member Avatar for JorgeM
0
312
Member Avatar for essuku

Hi, Is there any java functions are availble to find mostly repeated characters in string ? Thanks

Member Avatar for C-Money
0
211
Member Avatar for woomar

Hi. I am very new to hashtable concept. Here is a skeleton of the methods I need to implement; BUT, my biggest question is the inner Entry class. Am I implementing the entry class correctly?Is my constructor correct? Thanks public class HashTable<K, V> { /** define an inner class to …

Member Avatar for JamesCherrill
0
213
Member Avatar for Stefce

Hello everybody i have a little problem with making a java command for program i have some code but i do not know how to continue i stuck in one place BTW the command i want to make is > /sendcash [username] [money] // how it looks like I have …

Member Avatar for stultuske
0
229
Member Avatar for LyingInAHammock

Basically I've created an **app drawer** and placed a **seekbar** within it. This app drawer is made up from **app_drawer.xml** whilst my fragment below is made up from **main_activity.xml**. The issue I'm having is, although the seekbar shows up perfectly and the app drawer pulls in and out as it …

0
166
Member Avatar for Xabush

I a software engineering student who took a Java course last semseter.But currenlty I'm self-studying Java for expanding my Java knowledge.The problem is that Java is a very vast programming language and I'm confused where to head next. I would say I'm on the intermediate level with regards to Java; …

Member Avatar for C-Money
0
234
Member Avatar for garyndeborah.kuhre

Trtying to figure out how to add 5 different methods into this class when the program already does all that is required but my prof will knock me if I dont put them in here, do thet need to be put in as private?

Member Avatar for C-Money
0
286
Member Avatar for firepower

i need good java eclipse tutorial iv'e watched theCherno,Thenewboston etc.i learned GUI,anonymousclass etc.i just need a good beginner tutorial on java eclipse.

Member Avatar for C-Money
0
218
Member Avatar for ZaneDarklace

Hello. I am working on this project and it asks me to make two columns of words that are ascending in one column and descending in the other. This is the Project: Call both your project and class AscendDescend. The first column should be in ascending order and the second …

Member Avatar for C-Money
0
238
Member Avatar for AhmadHasanSahi

i want code of Sorting techniques like insertion sort , merge sort , bubble sort , quick sort. i want their output in gui or in any animation form in any language like c , c# or java. can any one help me plz ?Any one sorting technique is ok.

Member Avatar for C-Money
-3
150
Member Avatar for polpulpol
Member Avatar for C-Money
0
91
Member Avatar for anisha.silva

Hi, I am trying to read a html page and convert into xml and copy the content into a txt file in the local drive. The code below is to read the html page: def cleaner = new HtmlCleaner() def node = cleaner.clean(address) // Convert from HTML to XML def …

0
95
Member Avatar for zsman19

Hi Im new to learning java so far ive picked up the basics of it but now im trying to create a first and best fit algorithm for the purpose of memory managment now my question is what to i specifcally need to learn to be able to to this …

Member Avatar for Tarek_2
0
150
Member Avatar for mr.sweetchuck

Hi, I'm trying to use the replace() method to take out all instances of " " , (space) with an underscore, ("_"). I'm doing this because I'm using URLs to connect to a servlet. I keep getting this error: [code] replace(char,char) in java.lang.String cannot be applied to (java.lang.String,java.lang.String) url.replace(" ", …

Member Avatar for stultuske
0
6K
Member Avatar for msolomon.ashish
Member Avatar for mukulnimker7751

Hi All, i am here with a problem in file handling in java. i need to search all the files on system with extention *.fdr. which are not less den one day old. then i need to convert the selected file to csv which is perfomed by a command in …

Member Avatar for JamesCherrill
0
369
Member Avatar for jackjuma12

Hi guys Can anybody tell me what is wrong with this code? When I select the contractor number (with only one script code)it loads the details, but when I add the second function to load the farmer details, non now works!!!!! What am I doing wrong code <%@ page import="java.sql.*" …

0
111
Member Avatar for obscurecoder

I recently started coding in Java and have been trying to use the native methods to link code from other languages like C and C++. My code for the file is: [code=java] public class NativeDemo { int i; public static void main(String args[]) { NativeDemo ob = new NativeDemo(); ob.i …

Member Avatar for stultuske
0
192

The End.