32,204 Topics
| |
I have to write a program that repeats a sentence over a hundred times which also contains 8 random typos and have to have each sentence numbered. the sentence is: I will never spam my friends again the program's output should be 1. I will never spam my friends again. … | |
Hello, I have this calculator program that compiles and runs just fine, but my loop will not break as intendend too, when I hit 5 it it still runs the options to enter a number, here is my code: import java.util.Scanner; public class calculator { public static void main(String[] args) … | |
[Version 1](http://www.daniweb.com/software-development/java/threads/462737/generic-resizing-circular-array-.-do-i-need-to-implement-iterable-) had quite a few problems that i didnt think about. A lot of them were pointed out in the replies. I tried to correct them as best as i could to make this code. However , I'm having some doubts regarding what to do while implementing the Collection … | |
when dealing with files, is it possible to write or read any file extensions e.g. .docx, .pdf e.t.c.? | |
This is my program for a notepad! I am getting error at the part where I'm trying to extract the text from another .txt file!! I used the method realLine() but it only reads one line!! I want to know what other methods can I use here to extract the … | |
Hello, I'm attempting a calculator program, but I keep getting cannot find symbol errors, I believe I called everything I needed and initialized the variables, I do not know what's wrong. Here is the code: import java.util.Scanner; import java.io.*; public class Calculator { public static void main(String[] args) { do … | |
Since the underlying data-structure used here is an array , which is itself iterable via `for-each()` , i'm wondering how much benefit implementing `Iterable` will provide here. I would appreciate if someone could review my code and suggest any further improvements. **Code:** import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; class ResizingCircularArray<E> … | |
Hi, I need help , the assignment I have to do is for a healthprofile class but I am having issues . It doesn ' t show the month , day , or year in mm / dd / yyyy format it only shows 0 / 0 / 0 . … | |
hi,.... i am trying to develop a one-to-one [B]chat application[/B] as a part my j2ee web app (jsp and servlets used) ,... help me with this. what els should i learn in addition to socket programming? which architecture should i follow? how many days wil it take for an avaerage … | |
I'm pretty rusty on my Java skills but I was trying to write a program that prompts the user to enter a string and displays a maximum length increasing ordered subsequence of characters. For example, if the user entered Welcome the program would output Welo. If the user entered WWWWelllcommmeee, … | |
package numberpyramid; public class Numberpyramid { public static void main(String[] args) { int x = 9; for (int i =1; i<=x; i++){ for (int j =1; j<=x-i; j++) { System.out.print(" "); } for (int k=i; k>=1; k--) { System.out.print((k>=10)?+k:" "+k); } for(int k=2; k<=i; k++) { System.out.print((k>=10)?+k:" "+k); } System.out.println(" … | |
write a program in java language to append text to file using writer class | |
what is th use of converting an array list into an array ? | |
i am a newbie to java and I want to know how a thread can be implemented! | |
Hello! I would like some help with a piece of java code that i'm having problem. I have to make simultaneous tcp socket connections every x seconds to multiple machines, in order to get something like a status update packet. I use a Callable thread class, which creates a future … | |
Hi, I am using JSeparator as horizontal gridline. I want modify the JSeparator's continuous line display to dashed/dotted line. I am using Gridbag layout for my JPanel. Since I have to enable auto-resize for JSeparator, I cannot use a fixed length. I tried overiding paint & modified stroke to display … | |
hello! i am trying to launch a java program that calculates the time of launch. let's say i want to arrive at a certain place at 10:06:55 and it takes me 1:24:40 hours to get there, so to be able to write such program i should take in consideration several … | |
Hi Can someone explain to me why when i compare the array values for my code below,if i use "==",it will only compare 1 time. However,if i use ".equals", it will work correctly. import java.util.Scanner; import java.util.Arrays; class normalsorting { public static void main(String args[]) { String input; System.out.print("Enter Jumbled … | |
i am trying to access my video devices for live streaming using the code public class WebCam { private static Player player=null; //private static Processor processor=null; public static void main(String[] args){ try { MediaLocator mediaLocator=new MediaLocator("vfw://0"); player=Manager.createRealizedPlayer(mediaLocator); player.start(); Component video=player.getVisualComponent(); if(video!=null){ JFrame mediaTest = new JFrame("My WebCam"); mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mediaTest.add(video); mediaTest.setSize(300, … | |
Hi, I see a change in the font with string created by graphic2D from other labels. Is it possible to obtain a uniform font? package com.HIPS.biosynML; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.LineBreakMeasurer; … | |
I am trying to create Line objects and add them to an array list. The problem I am having is excluding any lines that are similar to each other. I have already created an equals method that compares two lines to determine if they are equal. I am having trouble … | |
Hello, well I'm doing a rational class and i'm having trouble with the subtraction part. I have done add, multiply, and division correctly. Therefore, I would like a little help on subtraction, and i'm set. public class Rational { // TODO Auto-generated method stub //Data members private int numerator; private … | |
I've been playing with JavaFX Scene Builder -- weirdly enough, all of my buttons have an extra pixel of height. The layout bounds are what I'd like, of course, but the boundsInLocal are always an extra vertical pixel long. This means the buttons aren't simply a pixel longer, it means … | |
Please tell me how to write a program which finds the frequency of each digit of an enterd number. Eg- if i enter 1112245 the output should come out to be 'Frquency of 1 is 3' 'Frequency of 2 is 2' 'Frequency of 4 is 1' 'Frequency of 5 is … | |
Have been studying [Reservoir sampling](http://en.wikipedia.org/wiki/Reservoir_sampling) for a couple of days , What I'v tried here is to draw a uniformly random sample of size 3 from a bigger data (the English alphabet) via reservoir sampling. Below is what i'v come up with. if anyone could review my code and offer … | |
Hi All, I am having a JTable which runs so strange. Jtable is very basic having three rows and three columns. If I use SetValue method to place data in any cell and run the program JTable is not visible. If i delete the SetValue Method from the program and … | |
I'm having a problem where i am making a simple combo box program that when it runs shows a pic, you can have a drop down box to select a different pic, very simple. I have an array for the file name of each, and a second array to store … | |
Im going to start learning android java so can anybody please tell me the good book for learning android for beginners? | |
I have been trying to implement a partially Dynamically generated GUI but an having trouble with the layout not rendering properly. Simply resizing the window corrects the issue. Here is the problimatic generation code: public void setupBookTabs() { ArrayList<String> bookTabNames = Record.getBookGroups(); for (int i = 0; i < bookTabNames.size(); … |
The End.