35,618 Topics
![]() | |
Im trying to average the user input by a string of numbers, It prints out without a problem but the output is very wrong Enter some numbers: 0,4,3,5 48.0 import java.util.Scanner; public class avg { public static void main(String[] args) { System.out.println("Enter some numbers"); Scanner in=new Scanner(System.in); String nums=in.nextLine(); double … | |
I have been working on this program for about a week now and I think I have it down pack. The issue I am having when I ask the user at the beginning of the game (human vs computer) everytime I run the program it asks me what my name … | |
Heelloooo good day. Thanks for seeking to help. I am creating a Java program(obviously). At the end of my work I wish to install it as (a)an .exe file. However I wish that after its installation, file type association would have been setup automatically(I phrased that latter part of the … | |
i'm creating the Simple CRUD Using Jsp, Servlet and MySQL program and i'm using the eclipse, and i all most done it, finally i'm going to run myself, it can't be run. i will install the jar file of jstl, servlet, mysql connector and finally standard.jar files are installed. but … | |
I created a custom 'text menu' that should print each String passed to it. This is the class: package com.github.geodox.areacalculator.menu; public class Menu { private static int index = 0; private static String[] menuItems; public void addItem(String menuItem) { menuItems = new String[index+1]; menuItems[index] = menuItem; index++; } public void … | |
Hello, I'm writting a code for comparing words in two sentences. I'm first comparing query with target (forward) and store the scores and again I'm reverse comparing target with query (reverse) and stores the score. I'm doing this inorder to solve the split word problem. For e.g. Sentence1: "Im working … | |
Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going … | |
Hello, I am new to visAD library. I am trying to plot a 'lowerTerrain.nc' file in visAD. But its longitude(-180 to +180) and latitude(-80 to +80) ranges are displayed automatically in -150 to +150 for longitude range(X axis) and -90 to +90 in latitude range(Y Axis). I have tried this: … | |
hello good people, i am trying to make a small program that takes input from 4 text fields and adds them to the database(i am using mysql through wamp server) and some other database operations. my Exit and Clear buttons are working. I am using Swing class but have done … | |
I want to make and If statement which will work when a double "credits" is between 1 and 9. But I'm not sure how to. Will If (1 <= credits => 9) Then Work? | |
hey buddy's i had one problem in servlet in jsp program. Exactly i'm getting this error, why i'm getting this error and how to solve this error., Have some tips: thanks in advance., | |
hey buddy's, i'm creating the program of employee details and i will inserted the fields are ADD,UPDATE,DELETE,EXIT,. I hope the all thing to find the exact solutions but, particular one thing only, that was UPDATE and these are the following some tips and code: 1.the input is not going store … | |
Hello Daniweb, I am creating a project (using NetBeans for GUI) for my Data Structures and Algorithms course. The gist of it is as follows: -Take 7 letters as input -Display a valid word as output (And later, when this issue is hopefully resolved, several words) Basically a software one … ![]() | |
Hello good day. I am having trouble letting my listeners wait on each other. I have a 1. JComboBox 2. JList - groups 3. JList - students The choice from the JComboBox, clears and updates the groups JList by way of an actionlistener. The ListSelectionListener for the groups JList, then … | |
Hi Team, Im reading collections and there is a topic called Backed Collections. I could not understand the output below . Please throw some light on it. TreeMap<String,String> map = new TreeMap<String,String>(); map.put("a","ant"); map.put("d","dog"); map.put("h","horse"); SortedMap<String,String> submap; submap = map.subMap("b","g"); System.out.println(map + " " + submap); map.put("b", "bat"); submap.put("f","fish"); map.put("r", … | |
DatagramSocket SERVERSOCKET = new DatagramSocket(9999); byte[] receiveData = new byte[2000]; while (true) { DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); SERVERSOCKET.receive(receivePacket); String LINE = new String( receivePacket.getData()); InetAddress iPAddress = receivePacket.getAddress(); int port = receivePacket.getPort(); } Ok I have this right now, I have been googling, yet I do not know … | |
hi, I have gui with layered pane and four buttons two buttons are above the layered pane and the two buttons are at the left side of the layered pane.the user can controll the size of the GUI but the proplem is that the buttons size doesn't change I want … | |
hello,my code is below mention, bt in this my eraser button doesnt show me any cursor in drawpad.. thanxxx in adva import java.awt.BasicStroke; import java.awt.Color; import java.awt.Cursor; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Point; import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import … | |
How to print xls or xlsx file to printer in java ? Is there any API or any reference ? | |
Dear All, I am reading Generics, below method is confusing. It clearly mentioned in the Method parameter that it should accept only List. But when i give ArrayList as Argument it compiles. It should be only List right? eventhough Arraylist is an implementaion class. below is the code PLease explain. … | |
First of all sorry , I am developing an messenger using servlet & jsp . please help me with code in servlet & jsp a user to register via register module, followed by login and use encrypted or normal chat. Each stated function depends on its own module. The encryption … | |
It is relaed to the thread i posted a while ago. Before I edited the model of my table, it was working properly, but when i added some columns thats when the problem came out. Everytime i click the button that will open this window, it goes blank. Only a … | |
Hi !! I am having a technical problem to run the code of servlet ,jsp and jar file .can you plz tell me how to put these in diferent folder to execute it..plz plz plz tell em the folder arragement to execute j2ee project.. Plz help i need help... | |
public static String DecBin(int nbr) String resultat=""; String decbin=""; //String temp; int rest; //temp=""; while(n/2>0) { rest=n%2; //temp=temprest; String rest1=Integer.toString(rest); resultat=resultat+rest1; } for (int i=resultat.length();i<resultat.length()-1;i--) decbin=String.valueOf(resultat.charAt(i)); return resultat; | |
Alright, so I have been coding a Ceasar Cipher in Java and I have the encrypting working, However, I cannot seem to find my problem decrypting. Here is the code, I thought just by revearsing all the operations it would decode it, but that doesnt seem to be the case. … | |
I am planning to create a table where everytime i add a row, a checkbox inside the table will also be created, will that be possible? And i am using window builder. If it is possible, can you give me some instructions how to do it? I did my research … | |
Write a program that simluates a game of dice. In this game, players take alternate turns rolling two dice. On each turn, they record the sum of the two dice and add this to their total. If a player rolls a doublet (both dice have the same value), then the … | |
I have recently shifted from c# to try Javafx2. I am also new to this forum. I have been stuck trying to implement internal frames in Javafx. I stumbled upon this link: http://stackoverflow.com/questions/17673292/internal-frames-in-javafx I have managed to add jfxtras 8 jar file to my project as well as in scene … | |
import java.awt.*; import java.applet.*; public class Neko extends Applet implements Runnable { public static void main (String args[]) { Image nekopics[] = new Image[9]; Image currentimg; Thread runner; int xpos; int ypos = 50; public void init() { String nekosrc[] = {"right1.gif" , "right2.gif" , "stop.gif" , "yawn.gif" , "scratch1.gif" … | |
I'm trying to implement an algoirthm descirbed here: http://pub.uni-bielefeld.de/luur/download?func=downloadFile&recordOId=2497720&fileOId=2525546 The purpose of that algorithm is to create a concept hierarchy based on a document corpus. For instants, a "Dog" concept would be a child of the "Animal" concept in such a hierarchy. To the point, I've come accross a peice … |
The End.