32,199 Topics

Member Avatar for
Member Avatar for mrod123

[CODE]import java.util.*; import java.lang.*; import java.io.*; class wordOccur { public static void main(String[] a)throws Exception { int i; int[]f=new int[20]; System.out.println("Enter the Sequence of the String:"); Scanner s=new Scanner(System.in); for(i=0;i<f.length;i++) f[i]=0; String t=s.nextLine(); count(t); } static void count(String t) { int[] f=new int[14]; int i; String d=" "; String[] temp=t.split(d); …

Member Avatar for stultuske
0
230
Member Avatar for xThrash

Hello everyone, Im working on a task where I have to implement an array list based complete binary tree but im not too sure how to do so. My java knowledge is very basic, whilst I could implement a normal binary tree, when its array list based im clueless. I …

Member Avatar for agieli
0
2K
Member Avatar for jehlaipixy

HELP ME PLEASE. I AM A 1ST YR COLLEGE STUDENT :/ Define an interface Filter as follows: public interface Filter { boolean accept(Object x); } Modify the implementation of the DataSet class to use both a Measurer and a Filter object. Only objects that the filter accepts should be processed. …

Member Avatar for jehlaipixy
0
449
Member Avatar for nicolemarie

Java error- java:12: class, interface, or enum expected? class ProgrammingProject01 { public static void main(String blabla[]) { System.out.println("Hello"); World world1 = new World(); Turtle turtle1 = new Turtle(world1); } } public void drawN1() { this.penUp(); this.moveTo(50,50); this.penDown(); this.setPenWidth(5); this.setColor(new java.awt.Color(255, 0, 0)); this.turn(180); this.forward(50); this.turn(180); this.forward(50); this.setColor(new java.awt.Color(255, 200, 0)); …

Member Avatar for stultuske
0
274
Member Avatar for jehlaipixy

This is a plate, requirement for our semifinals. Enhance the addInterest method of the SavingsAccount class to compute the interest on the minimum balance since the last call to addInterest. Hint: You need to modify the withdraw method as well, and you need to add an instance field to remember …

Member Avatar for stultuske
0
1K
Member Avatar for mahimahi42

Hi all, I'm working on a project for my CS class to go a little above and beyond the requirements. I have a simple GUI that takes in a username and password and checks a few things (needs uppercase and digit, etc), but I'm trying to have a JLabel that …

Member Avatar for stultuske
0
140
Member Avatar for long89

[CODE] class Circle { private double radius; private String colour; Circle() { } Circle(double r, String c) { this.radius=r; this.colour=c; } public void display() { System.out.println("Radius of circle is "+this.radius); System.out.println("Colour of circle is "+this.colour); } public String getColour() { return (this.colour); } } [/CODE] how calculate and display the …

Member Avatar for long89
0
151
Member Avatar for ForceStr

Hello, can anyone explain me why I'm still one step behind with this code? [CODE]private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) { try { DefaultTableModel model=(DefaultTableModel)jTable1.getModel(); model.setNumRows(0); String Name=jTextField1.getText(); String sql= "SELECT * FROM APP.Workers WHERE First_Name LIKE'" +Name+ "%'"; rs= stmt.executeQuery(sql); while (rs.next()) { String d1=(rs.getString("First_Name")); String d2=(rs.getString("Last_Name")); String d3=(rs.getString("Job_Title")); String d4=(Integer.toString(rs.getInt("ID"))); …

Member Avatar for ForceStr
0
173
Member Avatar for long89

how to write code include a try-catch statement to handle exception of this code. In the catch() statement, will provide a proper alert to the user on the error occurred. [CODE] import java.io.*; import javax.swing.JOptionPane; class TestArray { public static void main (String []args) { double a; double w; double …

Member Avatar for rushikesh jadha
0
393
Member Avatar for praset

I have problem when itegrate my webcam with JMF. I have got this following error, when i running JMFINIT or running jmfregistry and detect capture device. [CODE] Trying 6 352 288 Trying 6 768 576 Trying 7 160 120 Trying 7 320 240 Trying 7 640 480 Trying 7 176 …

0
145
Member Avatar for Kjeks

Hey! I got a Java Project which runs fine when i call the Main class with the java command. Made it into a -jar file with: jar cmfv manifest kort.jar * the manifest file contains [code] Main-Class: src.KortBord [/code] with the line break at the end when i try to: …

Member Avatar for JamesCherrill
0
380
Member Avatar for nijinjose123

Hi, I am experiencing memory leak in the activemq. i ran yourkit profiling tool and came up with the following leak as the top two. org.apache.activemq.command.activemqmessage org.apache.activemq.command.messageId is there any solution for this? Thanks

Member Avatar for nijinjose123
0
51
Member Avatar for Rowdy Busch

Hi and Greetings, I am new to these forums, so if I submitted this to the wrong forum, my apologies. Before I get to my question, a little backstory. I was running an application on my laptop that was using Microsoft Vista, with Microsoft Office 32 bit and JRE 1.5. …

Member Avatar for Rowdy Busch
0
431
Member Avatar for irishsailor

I'm fairly new to java and need help. I need to show time required to travel somewhere by having the user input Speed and Distance traveled. And the outcome be a floating point value. lets say they put in 60 mph and 148 miles I Can't seem to get the …

Member Avatar for NormR1
0
1K
Member Avatar for subone

Hi, I have a Java Final exam after few days. And I am looking for some website that contains [B]SOLVED [/B]programming exercises. Can anyone give me at least one site? Note: what I mean by [B]SOLVED [/B]is that I want the exercises to have solutions with them because I want …

Member Avatar for hfx642
0
287
Member Avatar for sonicx2218

I can't seem to figure out how to separate the code I wrote into 3 separate methods. 1. The main method, 2. the method that creates the strings i need and sends em back to the main method, 3. and the method that displays the if statement. [CODE]import java.io.*; import …

Member Avatar for stultuske
0
153
Member Avatar for Evenmu

Hey I am a student and i am new on the algorithm subject. I have been given a compulsory assignment that is to set up a program that have Liked list with Nodes. The problem is that i dont understand how to do this: - remove the first node - …

Member Avatar for DavidKroukamp
0
97
Member Avatar for ndrichim

Hello there.i have to find if elements of a row are equal to elements of another row.this is my code but it wont work. when k becomes 1, i want the for loop at i to start with i=2; can you help ????? int b[][]={ {1,2,23,4,5}, {6,1,8,9,28}, {11,12,13,14,15}, {1,17,18,19,20},}; for(int …

Member Avatar for ndrichim
0
149
Member Avatar for riahc3

Hey I would like to do a ".bat' type of command in Java: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a …

Member Avatar for riahc3
0
442
Member Avatar for J.S.AlKatheeeri

Hi, I am trying to make a game board in java. The idea is that the user will enter the length and this will be squared and the board with corresponding number of squares will be displayed. Any ideas on how to do this? I know it'll involve some kind …

Member Avatar for Ezzaral
0
97
Member Avatar for jpsider

Hi all, I'm working on a school project and I am running into a problem, possibly more... This is my first post, so I am sorry if it ends up ugly. Here is a description of the project: This project focuses on demonstrating your understanding of classes and objects. Before …

Member Avatar for Philippe.Lahaie
0
9K
Member Avatar for rushikesh jadha

i want create jar file of my source code using netbean but i dont know how to do that please help!

Member Avatar for stultuske
0
80
Member Avatar for JavaPrograms

shell-scripting @ DaniWeb - Hello fellow members, I would like to ask for your assistance in creating a batch/autorun/exe file which can help me to make an autorun usb. So basically, I would like the USB to do the following: When usb is inserted, it should autorun and copy files …

Member Avatar for technoknol
0
785
Member Avatar for ilovejava

I had to make a arrayList and i do not know why is it not working [CODE]public class ArrayList<E> { private E[] theArray; private int size; private int capacity; public ArrayList(int initialCapacity) { this.size = 10; this.capacity = initialCapacity; theArray = (E[]) new Object[initialCapacity]; } public ArrayList() { this(1024); } …

Member Avatar for ilovejava
0
205
Member Avatar for steven8579

I have an array where of integers that has to be sorted and inserted into the correct place in the array for each number, not just at the end. All of this is done in the add method. This is what i have so far. [CODE]package sortedintlist; public class SortedIntList …

Member Avatar for JamesCherrill
0
381
Member Avatar for androidf

I need to have a update button to update a edited textfield and save it to the database. I have created the button but have no idea on how to make it update the edited textfield and update the SQL database automatically. Pls help!!): This is my code: [CODE]private JButton …

Member Avatar for androidf
0
1K
Member Avatar for sarathsshanker

says the R.java cannot be resolved but the reason seems to be not solved by refreshing or clean building the code..it has something to do with the different build target paths

Member Avatar for stevelg
0
66
Member Avatar for Queen Lala

import java.awt.*; import javax.swing.*; /*<applet code="SampleApplet1",200,300> */ public class SampleApplet1 extends JApplet { int num; public void init() { num=20; } public void paint(Graphics g) { g.drawString("Hello to Applets.Session"+num,70,80); g.showStatus(getAppletInfo); } public int getAppletInfo()//Overrides super class method { return("Created by PTSS"); } public static void main(String arg[]) { SampleApplet1 obj= …

Member Avatar for rushikesh jadha
0
163
Member Avatar for mehnihma

Can you help me with one problem, I dont know how to invoke action op menu not the menu item? I have File and Help menus and I need to invoke action when the Help menu is pressed but dont understand how, I know how to do in on MenuItem …

Member Avatar for DavidKroukamp
0
1K
Member Avatar for Torf

File, new project, Java+Java application, Project name just a random name, finish. Then.. new file, Java+Java class, Class name payroll, finish.. [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javaapplication5; /** * * @author computer public class …

Member Avatar for JamesCherrill
0
961

The End.