32,199 Topics
| |
Hello Again, I am in need of some help getting my GUI to display the inventory values. The code runs and compiles successfully, but it does not display anything. I am new to this and could use some help. Thanks! package inventory; import java.text.DecimalFormat; import java.util.Arrays; import javax.swing.*; import java.awt.*; … | |
I wrote a java program/application and I'm trying to combine all the .class files into one .exe file. I want to have a convenient double-clickable EXE file to launch the program without the user having to handle .java file associations. | |
try{ String str = "select * from stocks"; stmt = conn.prepareStatement(str); ResultSet rs = stmt.executeQuery(); while(rs.next()) jcbStock.addItem(rs.getString("stockID")); }catch(Exception e){ e.printStackTrace(); } I have this code in other class , and i want call it in my main class. Anyone can tell me how to do? | |
Hi to all of you! I'm using Eclipse Luna 4.4.1 for Mac. I have made a project for a Java seminar I am attending.My project consisits of several classes that runned perfectly fine...until today.That is , when I opened one of my classes and made some changes I started getting … | |
i need to write a program to output an ascii art pattern. the size of the pattern should change dynamically based on class constants. if i change the class constants, the pattern changes. Should look like this Number of boxes: 4 Width of boxes: 6 Height of boxes: 3 +------+------+------+------+ … | |
Beginner programmer here and I am lost on a project for a class. I have to develop a Java application that calculates the monthly paychecks for a numbe of different types of employees. The employee types are created in a subclass array based on parent base class Employee. The initial … | |
Hi I need to add a line above my pdfcell in pdf table but I do not know how to do it. | |
Convert from int arraylist to string arraylist and double arraylist to string arraylist java | |
does anyone have any ideas or codes in building a game using java codes. my last assignment is building a game and I have no idea what to do or how to even start and where to start. can anyone give me any ideas on how do I go about … | |
Hi, Everyone! So, i need a simple swing binary tree code, if anyone of you guys have it, please share to me =( Thanks, a big hug. | |
Hello everyone!!! Can anybody help me to fix this error... While running my game source code on command prompt i get one error. Note: tetris.java uses or overrider a deprecated API. Note: Recompile with -deprecation for details. please help me to fix it. | |
Hi I have a arraylist of string , I want to parse this arraylist to my pdfpcell , but my arrayList keep looping here is my code ArrayList testList = new ArrayList(); 1,2,3 for(i=0; i<testlist.size();>{ new PdfPCell(new Phrase(testList.get(i)); document.add(table); } document.close(); | |
i wrote an program relating to employee payslip but i got an error..can u clarify me?`Inline Code Example Here` class Employee{ int empId; int bSal; Employee(int a,int b){ empId=a; bSal=b; } } class PayShip{ int calculate (Employee e6) { int os=e6.bSal; int ta=(os*5)/100; int vehAlo=(os*10)/100; int da=(os*2)/100; int grossSal=os+ta+vehAlo+ da; … | |
I initialize the salary and this is the result i get, is it correct, to me it doesnt look correct, I could be wrong public static void main(String[] args) { Scanner scan = new Scanner (System.in); int age, sum, difference, old_salary, new_salary, salary = 0; System.out.println("Please enter the person age"); … | |
My problem is sorting strings given in three lists using implementation of A* search,so I need to develop a heuristic function that will make solving various instances of this problem efficient. The state can be represented s a list of 3 lists, example: [ [C B], [D], [H G F … | |
Hello my friend out there i realy need help .i'm working on one of my class labs but things is not that write to me...could one out there assist me thanks you. here is the quz<<<<<< Write a program in HTML and JavaScript for the following tasks: Find the maximum … | |
import java.util.*; public class temp { public static void main (String[] args) { //Declear variables int LowT=0, HighT=0, high, low, RangeT=0, zip, k, d, i; double Avg, HighAvg=0, LowAvg=0, RangeAvg=0; //New Scanner Scanner input = new Scanner(System.in); //Informs user on what the program does System.out.println("This program calculates highest, lowest and … | |
Write a program to input a person’s age and salary. If the age is over 32, then add $1000, otherwise subtract $500 from salary. Finally output the age and new salary. here is the problem Scanner scan = new Scanner (System.in); int age, sum, difference, old_salary, new_salary, salary; System.out.println("Please enter … | |
| How do I add HTML5 functionality to my browser? Its still a work in progress, so ignore the event handlers and buttons that seem pointless... package browser; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class ReadPage extends JFrame { private JTextField address; private JEditorPane display; private JButton refresh; … |
Hello, Thank you for your time! I have an applet where I have two blocks moving: When the program starts: a)The first block is constantly moving with a time delay of 100 ms about the horizontal direction at the top end of the applet (x starts at 0 and is … | |
the program works the way i want it to except for the inputmismatchexception. import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.InputMismatchException; import java.util.Scanner; public class Exception { public static void main(String[] args) throws IOException { int num = 100; int tempNum; int index; String[] strArray = new String[num]; int[] numArray … | |
I have user login info stored with JPA along with a room. The room has a list of users, the users have a transient field, which is where my problem is coming in. @Entity public class User{ //some other stuff ids and such @Id @GeneratedValue(generator = "increment") @GenericGenerator(name = "increment", … | |
for(int i-=0; i<firstItems.size(); i++ { table.addCell(String.valueOf(firstItems.get(z))); document.add(table); document.close(); response.addHeader("Content-Disposition", "attachment; filename="test.pdf"); OutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); } Hi I got an error stating the document has been closed. You can't add any Elements. | |
Hello buddies! I'm new at Java SE Porgramming with PHP background. I've made a simple app which uses JSON to save some data and I would like to use MySQL database but there was some question for me. 1. If I used MySQL or any database, how much would my … | |
Hi everyone, Consider below code, package thread; public class Noti5 extends Thread{ Calc c; Noti5(Calc calc){ c = calc; } public void run(){ synchronized(c){ try{ System.out.println("waiting for calculation.."); c.wait(); }catch(Exception e){} System.out.println("Total is.."+c.total); } } public static void main(String[] args) throws InterruptedException { Calc calculator = new Calc(); new Noti5(calculator).start();new … | |
Hi guys I need help on the code for this problem with using string. Can someone give me the answer to this problem and on how you do it with explanation but most improtantly the answer. Thank you Method unscramble returns a version of String str with each pair of … | |
//Trevor Potter // Nov. 11,2014 import java.util.*; public class student { public static void main (String [] args) { int[] student= new int [20]; int[] exam1= new int[20]; int[] exam2= new int[20]; int[] exam3= new int[20]; int[] avg= new int[20]; int i=0; Scanner input = new Scanner(System.in); for(i=0; i<=19; i++){ … | |
Hi, Currently we have legacy system which is build purely using java and runs on jboss. We notice its using a lot of jms and also httpurl connectivity to pass on files. The system basically supports rossetta net framework where it allows file transfers between trading partners. We notice with … | |
Hello, Thank you for reading my message! I have an applet, where I make two instances of the custom JPanel objects and I add them into two JFrames and display them. Both of these panels have a 10 x 10 grid of buttons and an event handler is added on … | |
write a algorithm in pseudocode for the procedure: input a person's age and salary. If the age is over 32, then add $1000 to the salary but otherwise subtract $500 from the salary. Finally, output the age and new salary: this is the question: here is the answer well the … |
The End.