32,199 Topics
| |
Hello everygone!! I signed up here hoping I will receive some help. I realize that every 2nd person writes: I am new...bla bla bla. I am new:)...I was sitting last 2 days trying to solve the issue and I think I am close but I don't see something. This is … | |
I am currently working on writing a simple vending machine that dispenses just one drink, I am just a beginner at this so I would appreciate some help from this community. [CODE]package assignment1; public class VendingMachine extends java.lang.Object{ // fields java.lang.String givenDrinkName; private int givenDrinkPrice; private static final int INITIAL_BALANCE … | |
this is my problem! I have to create a console application that asks for numbers of quarters, dimes, nickesl,and pennies. I have to use the Scanner class that read in the integer values for each coin. Calculate total values in cents. Calculate number of dollars and remaining cents. [CODE]import java.util.Scanner; … | |
Hi, I'm trying to set custom fonts, I can do it without problem with this code: [CODE] InputStream is = this.getClass().getResourceAsStream("/src/someFontName.ttf"); Font f=null; try { f = Font.createFont(Font.TRUETYPE_FONT,is).deriveFont(15f); } catch (FontFormatException ex) { Logger.getLogger(PanelLiquidacion.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(PanelLiquidacion.class.getName()).log(Level.SEVERE, null, ex); } txtPlace=new JTextField();txtPlace.setBounds(185,10,310,20); if(f!=null){ txtPlace.setFont(f); lblPlace.setFont(f); … | |
I have an assignment Enhance the CashRegister class so that it keeps track of the total number of items in a sale. Count all recorded purchases and supply a method int getItemCount() that returns the number of items of the current purchase. Remember to reset the count ast the end … | |
I have three classes. I have a main app, a Draggable class, and a creator class. I want it so that when i click on one rectangle it produces the same exact dimensions as the shape i pressed. However, the problem is that when I use mousePressed, it seems that … | |
Hi, I have a program that generates an outputstream with XML-data. With a socket connection, I have to read multiple XML-files from the inputstream. To read only one XML-file from the inputstream is not a problem, the fact that there are more than one and I have to split up … | |
Hi guys (again), I have a new issue. I am trying to bubble sort my array of objects to display in alphabetical order. Here's the code: [B] Subscriber class:[/B] [CODE]package assignmentone; import java.util.Scanner; import java.util.StringTokenizer; import java.util.Random; /** * * @author Bill */ public class Subscriber { //Field declarations private … | |
Hey everybody I really need help on a problem in a Java code. Any help would be really appreciated. The problem is to : Write a test program that prompts the user to enter a11, a12, a13, a21, a22, a23, a31, a32, a33 for a matrix and displays its inverse … | |
using java? how i'm going to get the data in notepad. in short of file streaming? | |
Hello I am using windows vista and the problem is that \r i.e., carriage return does not work properly on my system. When I run my java code, it inserts a new line rather than returning the carriage. Can anyone suggest a solution to this problem? | |
[CODE] import javax.swing.JFrame; public class snake extends JFrame { public snake() { add(new Board()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(320, 340); setLocationRelativeTo(null); setTitle("Snake"); setResizable(false); setVisible(true); } public static void main(String[] args) { new Snake(); } }[/code] This is Board.java file: [code]import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; … | |
Hi All, I was having trouble with getting my program to display all the necessary conversions. Here is a snippet of the code to help explain what I want to do: [CODE] private class CalcListener implements ActionListener{ public void actionPerformed(ActionEvent e){ String centInput, inchInput, meterInput, yardInput; double cent, inch, meter, … | |
Ok im exhausted and just want to go to bed and this has been frustrating me for the last 45 minutes. This method needs to include a check for a 10 digit number from the acctNum and then parseInt but im just brain locked as to where to even put … | |
So basically i've been thinking really about the different programming languages as i have been looking at computer science courses at university. A lot of the courses use java as their main programming language. It got me thinking, is Java the future of programming and if so why? I am … | |
Hey guys, I have this code wherein I have 4 buttons to determine what set of values to display on my jtable. I've successfully displayed my data. After running the program, clicking a button, data is displayed in the jtable. Problem is, when I minimize/maximize the window, the data disappears. … | |
I've often pondered over this subject. I know the main method has a special signature the JVM looks for, but why is it static? | |
[CODE]I am planning to make an application that can graph all functions.(polynomials, rational, trigonometric,etc) but I can't make a decision on which programming language I am going to use. I am choosing between Java and VB.net. what are the ups and downs of these languages? Which one would be better … | |
hi i put information in jtable how can i print the content of jtable? | |
Hello frnds I need sm help for installing JAI on my computer! the file im getting from sun's site is a corrupt file! Pls Help Me! | |
Hello ! As I wrote in the title. I'm looking for a Java command wchich is simmilar to ' tr -s" " ' in UNIX. tr -s"[sequence]" : Replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character. thanks for … | |
Good Evening! We recently had a project about java, and i chose to make a program that measures time. What i want is like a server in computer shops, but i dont know how to make a timer, displayed while running.. i guess it must have a loop to increment, … | |
hi i am trying to make a CAD program that read a text file which contain a vertecises and number of triangles, which look something like this"the file" : 8 -2.0 -1.5 -0.5 2.0 -1.5 -0.5 -2.0 1.5 -0.5 2.0 1.5 -0.5 -2.0 -1.5 0.5 2.0 -1.5 0.5 -2.0 1.5 … | |
Hello! I'm trying out an idea I had which requires me to capture the contents of a java window/Frame, much like a screenshot but without the window and menubar, just the contents rendered in java, i.e. an exact image of what is visible in the java application at the moment. … | |
Hello, I am beginner Java programmer and I would greatly appreciate help. The sections with which I need help are pointed out by comment lines. I am having a lot of difficulty with methods and I do get the basic function of them but I don't know how to implement … | |
I am new to programming, so please accept my apologies if this question is simple. I have a class (say called Student). I want to store the name of the student (name) and the course (course) I have declared some variables in my Student class: [code] private String name = … | |
I'm having some trouble with this section of code: [CODE] for(int i = 0; i < MAX_NUM ;i++) { subList[i].readIn(); System.out.println("\nDo you want to enter another subscriber? " + "(Y/N): "); anyMoreSub = keyboard.nextLine().toUpperCase(); if (anyMoreSub.equals("N")) { break; } } while(!isDone) { menuChoice = JOptionPane.showInputDialog("Please enter the letter for " … | |
hi guys i am doing an applet that reads information from a website, stores it and uses it to graph the data and displays it in a very friendly way. it works perfectly fine in the viewer when i run it in eclipse but as soon as i try to … | |
I have to do my first assignment for my java class for friday this week. So due in 3 days. I wrote the polynomial class but haven't done the driver for it yet as i don't know if my polynomial class is good. Please check and let me know if … | |
please, i am new to java and have this project on generating a university timetable using genetic algorithm. this software is to be a GUI based software... please can any one give me ideas about how i can go about it... thanks |
The End.