32,199 Topics

Member Avatar for
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
242
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
521
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
590
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
Member Avatar for Eccoo

I just started to learn java, and the first program I have to create is called PizzaRun, here is description: PizzaRun is a simple program that calculates the number of pizzas to buy based on the sum of the slices entered on the command line arguments after the first argument, …

Member Avatar for Eccoo
0
395
Member Avatar for brylle.kunot

pano po kung ganito ang output na dapat lalabas? ########### [1] DEPOSIT # # [2] WITHDRAW # ATM # [3] INQUIRE BALANCE # # [4] EXIT ###########

Member Avatar for ChrisHunter
-1
88
Member Avatar for Ken1234

Display 100 random integers in [10, 25] 14 14 18 24 12 25 16 12 18 16 15 16 16 15 17 19 10 21 14 25 21 24 10 19 25 17 19 13 25 24 23 25 15 25 18 23 18 14 24 11 21 12 20 …

Member Avatar for Ken1234
0
329
Member Avatar for Birol

I have some questions regarding design pattern (DP) usage, in particular for Java developers. i) Which DPs have you used, as far as you can remember, and how often? ii) How much have they helped your development work? iii) If you work in a project group, are there group standards …

Member Avatar for prakash.kadam.5851127
0
297
Member Avatar for vikkox7

can someone write a javaprogram to create a class that store objects with an inventory when the size was 20 and then expands to 100. print from 100-120

Member Avatar for JamesCherrill
0
90

The End.