32,204 Topics

Member Avatar for
Member Avatar for HacruLeian

i have a .csv file contain some name as below: William Shakespeare charlie chaplin david Copperfield and i'm supposed to write a java program that will turn the input above into the output below: WS cc dC but i still couldn't get the output that i want, i wanna ask …

Member Avatar for HacruLeian
0
1K
Member Avatar for yaya123

I am writing code that has classes like playlist,album,artist,song in playlist class i need to write a method that will play the first song public void play(){ //the code } what sould I write

Member Avatar for JamesCherrill
0
105
Member Avatar for kristian.ssyn

I've been trying to resize my jbuttons to the size of my pictures, but the jbuttons keep on occupying the whole frame. The size of the photos are 150x267. import javax.swing.*; import java.awt.event.KeyListener; import java.awt.*; import java.awt.event.KeyEvent; import java.util.Timer; import java.util.TimerTask; public class StartGame extends JFrame implements KeyListener { Timer …

Member Avatar for JamesCherrill
0
13K
Member Avatar for Richa_2

import java.util.Scanner; package p1; class Electricity { int cread=18634,fix_rate,due,ub_tax,curr_charge,bill,to_bill ; int pread,unit ; System.out.println("fix_rate="); Scanner sc=new Scanner(System.in); int fix_rate=sc.nextInt(); System.out.println("due="); int due= sc.nextInt(); System.out.println("ub_tax="); int ub_tax= sc.nextInt(); System.out.println("curr_charge="); int curr_charge= sc.nextInt(); System.out.println("unit="); int unit=sc.nextInt(); public void calc() { do { pread=cread-unit; System.out.println("fix_rate=" +pread); } while(unit<200) { int c1=2.75*unit; System.out.println(c1); } …

Member Avatar for Richa_2
0
294
Member Avatar for abhig

Write a program in Java to create an applet which take radius of a circle as input and find the area of a circle and draw the circle. Java Code: // Java Document import java.applet.Applet; import java.awt.Color; import java.awt.Event; import java.awt.TextField; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; class Circle extends …

Member Avatar for JamesCherrill
0
443
Member Avatar for ganges

Hi Friends have a nice day, is there any certification exam for Hibernate and Spring like oracle certification. if so kindly guide me. thanks for your time

Member Avatar for stultuske
0
94
Member Avatar for stupidenator

Hey Everyone, This is my first post. Recently, I have been working on an instant messenger program in java. I have created the networking part of the client, and I have almost finished the server side. I know the program works and I am allowed to send messages, but now …

Member Avatar for stultuske
1
2K
Member Avatar for anku83

package JavaApplication42; import java.io.*; import java.io.IOException; import java.util.*; import java.io.BufferedReader; public class DPmodification { public static void main(String[] args) { BufferedReader br = null; int n, c, d,k, swap,i=0,j=0,no_of_selected_item=0; int numItems; int numTransactions; double minSup; String configFile = "F:\\New Folder\\configtrial.txt"; try{ FileInputStream file_in = new FileInputStream(configFile); BufferedReader data_in = new …

Member Avatar for iamthwee
0
285
Member Avatar for amir4g

Hey, I have a lab to do, but I'm stuck on one part of it which is probably really easy but I can't figure it out. This is what I have so far, but it doesn't compile, and then I have to use polymorphism to output it. The purpose of …

Member Avatar for JamesCherrill
0
349
Member Avatar for kristian.ssyn

Hi! I'm just new at GUI programming and I've been busy creating a GUI for my project. My image won't show up in this particular code. I've made two other classes and the images load perfectly. import javax.swing.*; import java.awt.image.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class Battle implements …

Member Avatar for JamesCherrill
0
265
Member Avatar for Lia_2

I got a code from a book on Fibonacci written in java. And because it's still raw, I did some editing to it (change some lined of code, add code that enables input etc). But, it doesn't work. The other three fibonacci programs (with different algorithm) work fine, but not …

Member Avatar for hannahaddad
0
302
Member Avatar for corby

Hey im trying to run background music when the user clicks the button. below is my coding. when i run the program, it says file cannot be found. any help would be appreciated [CODE]import javax.swing.*; import sun.audio.*; import java.awt.event.*; import java.io.*; public class Sound { public static void main(String[] args) …

Member Avatar for JamesCherrill
0
6K
Member Avatar for yasheela

import java.lang.*; import java.util.*; class Project { public static void main(String a[]){ Hashtable<String,String>language=new Hashtable<String,String>(); Enumeration<String>names; String str1; String lang; language.put("insert","Load"); language.put( "select","Dump"); language.put("*","All"); language.put("from","as"); language.put( "where","Filter"); language.put( "Group","Group"); language.put ("Join","Join"); language.put("Order By","Order By"); language.put("Distinct","Distinct"); language.put("Count in lines","Limit"); language.put("set","set"); language.put( "Describe","Describe"); language.put( "Group By","CoGroup"); language.put("delete","Flatten"); language.put("dual","Sample"); language.put( "into","as"); language.put( "count *","count …

Member Avatar for hannahaddad
0
137
Member Avatar for StarTrekCafe

hi. can any one help. i am doing a java application. and using a button listener class. and says cannot find the text box object. can you help. will do the sample code. how to get this to work. marvin. ps: here's the code if(e.ActionCommand().equals("btnName"}} {JOptionPane.showMessageDialog("My name is: " + …

Member Avatar for stultuske
0
167
Member Avatar for Gl753

I'm working on a Database assigment but I'm kind of stuck. It seems to be the Double value that's causing the issue because when I use the Varchar data type I can create my table. Is there any way I can use Double without using Varchar. Any help is much …

Member Avatar for Dani
0
261
Member Avatar for nabilmahesaniya

hey guy i have adoubt regarding public void static i mean im not able to get when to write at that time ith public void......... so can someone help me

Member Avatar for Philippe.Lahaie
0
157
Member Avatar for daniel1977

I don't think I fully understand the concept of looping. Below is what I put into eclipse and the results I get, am I doing something wrong to get the correct results if you could help thanks /* Working with a sentinel value Anderson, Franceschi */ import java.util.Scanner; public class …

Member Avatar for hannahaddad
0
250
Member Avatar for ameer.mhmed

method non static public class LoGIne{ public String user (String a){ String rr = txt_user.getText(); String pass = txt_pass.getText(); //ConDb(user,pass); return rr; } --------------------------------------------------- method static public static Connection ConDb(){ //String USER ="mh"; String d ,l,h; d =("ameer"); String PASS=d; LoGIne a = new LoGIne(); String USER = a.user(h); // …

Member Avatar for ViolaPAllen86
0
402
Member Avatar for mohan@nano

i have a text box in that i'll enter a value . The value should generate the tree structure using javascript .is there any pulgins for the above . please suggest me

Member Avatar for mohan@nano
0
69
Member Avatar for mjsh

Hey, so I have an assignment for java using the hailstone sequence. My teacher wants us to print out the length of the longest sequence and the number for that. The problem I'm having is that I need to print out the actual sequence underneath the first part. Can anyone …

Member Avatar for JamesCherrill
0
818
Member Avatar for susanna.newkirk

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package theaterrevenue; import javax.swing.*; import java.awt.*; import java.awt.event.*; /** * * @author */ public class TheaterRevenue extends JFrame { final double percent = .20; double adultCost; private JTextField label2; private JTextField …

Member Avatar for susanna.newkirk
0
768
Member Avatar for rubeea.jaffari

Hello everyone, I am designing a simple game with graphics in which I am trying to add a keyListener to my Jframe but the keyListener nor the mouse Listener seem to respond. Here's the code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import javax.imageio.ImageIO; public class PaintDemo …

Member Avatar for JamesCherrill
0
440
Member Avatar for Datagram

Hi all, I've just started out with programming and I'm working on a Binary Tree of integers. I have the Node and BinaryTree classes almost complete, but I'm having a derp moment trying to test my minimumVal method from the main and not sure on what to pass into the …

Member Avatar for Datagram
0
278
Member Avatar for napninjanx

So far I learned how to download the JDK Java Development Kit. Then created a PATH file cause it the training video they said something about sp Java won't mix up directories and so on. So putted the semicolon at the end of the Path File... In Environment Variables. Then …

Member Avatar for napninjanx
0
277
Member Avatar for anku83

I have this code which finds the duplicate rows .I want to check if the top row has weight greater than given minimum support..If true then generate its subsets. If row 1 i.e 11110011 wight>min_sup then generate subsets....if not then jump to next row here 1 represents presence of items …

Member Avatar for anku83
0
314
Member Avatar for Ismail_3

hi all, i need lil help to do this program Students number = 10 Students name= Ahmed, Ismail, Mohammed, Esra, Ali, Omar, Abulla, Khalid, Talal, Sara Develop a program in Java to accept the number of students in a section for a subject and for each student accept the Student …

Member Avatar for Ismail_3
-1
176
Member Avatar for gahhon

i am new to the e2glite due to assignment required. Currently using SWI-PROLOG as my coding software, and now i was copy some example code and also downloaded e2glite.jar from e2glite web, after i follow their instructions, i am able to view the java on browsers but i can't able …

Member Avatar for Nimrah
0
322
Member Avatar for asif49

Given a Java project created using Netbeans that has some libraries added (.jar files) - these are required for the project to work. If the project is copied over to another computer will these .jar files need to be added again?

Member Avatar for jwenting
0
122
Member Avatar for NetroNeil

# Hey guys, I'm having a problem with trying to replace a string in funky.jar from a java program. # The string in funky.jar is called house. The default value of house = "brick". Is there a way I can code my java program to change funky.jar's string to maybe …

Member Avatar for stultuske
0
168
Member Avatar for erik.pierce1

I cannot for the life of me get my GUI to comeup with my deckPanel displayed along with my JButton that I intented to add an Action Listener to. THanks for looking. I am sure it has something to do with my object creation and method calls. import javax.swing.*; import …

Member Avatar for erik.pierce1
0
130

The End.