32,204 Topics

Member Avatar for
Member Avatar for eldiablo1121

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. …

Member Avatar for stultuske
0
174
Member Avatar for eldiablo1121

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) …

Member Avatar for eldiablo1121
0
349
Member Avatar for somjit{}

[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 …

Member Avatar for somjit{}
0
295
Member Avatar for michaellooks

when dealing with files, is it possible to write or read any file extensions e.g. .docx, .pdf e.t.c.?

Member Avatar for michaellooks
0
128
Member Avatar for YumnaZia

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 …

Member Avatar for YumnaZia
0
334
Member Avatar for eldiablo1121

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 …

Member Avatar for eldiablo1121
0
431
Member Avatar for somjit{}

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> …

Member Avatar for somjit{}
0
1K
Member Avatar for ZombieKnight93

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 . …

Member Avatar for asaa
0
249
Member Avatar for beanboy

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 …

Member Avatar for JamesCherrill
0
198
Member Avatar for JadeRayne

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, …

Member Avatar for JamesCherrill
0
509
Member Avatar for darylglenng

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(" …

Member Avatar for pallav89
0
639
Member Avatar for ANGELA SENKUNG
Member Avatar for JamesCherrill
0
82
Member Avatar for ganges
Member Avatar for buddareddy.java
-1
269
Member Avatar for YumnaZia

i am a newbie to java and I want to know how a thread can be implemented!

Member Avatar for YumnaZia
0
246
Member Avatar for nlkm
Member Avatar for ktsangop

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 …

Member Avatar for ktsangop
0
523
Member Avatar for Neha_4

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 …

Member Avatar for JamesCherrill
0
218
Member Avatar for fadi 751

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 …

Member Avatar for JamesCherrill
0
161
Member Avatar for cleve23

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 …

Member Avatar for ashishyete
0
156
Member Avatar for rahulcs99

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, …

Member Avatar for stultuske
0
168
Member Avatar for srikanth2321

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; …

Member Avatar for srikanth2321
0
192
Member Avatar for KellzDD

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 …

Member Avatar for stultuske
0
591
Member Avatar for kay19

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 …

Member Avatar for kay19
0
226
Member Avatar for Kapitaen M

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 …

Member Avatar for Kapitaen M
0
94
Member Avatar for Lmbcabhi

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 …

Member Avatar for somjit{}
1
6K
Member Avatar for somjit{}

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 …

Member Avatar for somjit{}
0
156
Member Avatar for murali2489

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 …

Member Avatar for murali2489
0
353
Member Avatar for MichaelCJ10

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 …

Member Avatar for MichaelCJ10
0
195
Member Avatar for ahmed.talha.16

Im going to start learning android java so can anybody please tell me the good book for learning android for beginners?

Member Avatar for peter_budo
0
113
Member Avatar for DarkLightning7

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(); …

Member Avatar for DarkLightning7
0
176

The End.