32,199 Topics
| |
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(); … | |
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, … | |
pano po kung ganito ang output na dapat lalabas? ########### [1] DEPOSIT # # [2] WITHDRAW # ATM # [3] INQUIRE BALANCE # # [4] EXIT ########### | |
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 … | |
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 … | |
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 |
The End.