32,199 Topics

Member Avatar for
Member Avatar for Doogledude123

I know you're not supposed to use Lightweight Components like JFrame with non-Lightweight Components like JFrame, so my question is, what do you use with a Canvas? Is there also some example code for it? Thanks!

Member Avatar for JamesCherrill
0
475
Member Avatar for Vinolia

Implement the following class.the class has two instance variables num for the fraction numerator and den for the fraction denominator. public class Fraction implements Comparable<Fraction> public Fraction(int num, int den) // initialize instance variables public int den() // returns the denominator public int num() // returns the numerator public Fraction …

Member Avatar for Vinolia
0
251
Member Avatar for snehil_1

I had created my Qt C++ application and now I am thinking to provide it as a plugin or as library in Eclipse. I know there is CDT plugin, but I don't won't to write my code again. Is there any way to achieve this? Snippet for QPushbutton in qt …

0
107
Member Avatar for divinity02

I ave ah questions it is just a question, so dont penalized me okay question 1: how do you spot logic errors question 2: how do you fix it question 3: what can be done to try to prevent it, is there a way

Member Avatar for ddanbe
0
240
Member Avatar for katie6580

I am creating a program that takes two english words from the command line and prints one out vertical and the other horizontal and sees how many times the words cross. If they don't cross it then prints out an error message. Here is what I have so far for …

Member Avatar for JamesCherrill
0
411
Member Avatar for Doogledude123
Member Avatar for JamesCherrill
0
326
Member Avatar for Violet_82

Hello guys, long time no see! i've put together a very small simple console base application that takes a date and a few strings and print them off. Let's look at the code first. Date.java /*Date.java this class represents dates */ public class Date{ private int month; private int day; …

Member Avatar for jwenting
0
2K
Member Avatar for Cory_1

I am attempting a heap sort that sorts from lowest to highest. My code runs and displays, but I have some issues. The output I get is: The values in the heap array are: 8 9 2 3 4 1 5 6 7 Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 9, …

Member Avatar for Taywin
0
238
Member Avatar for 76342ck

Here's the instructions: Write a Song class that contains the following properties along with appropriate get/set methods. Please note this is a pretty simple object and not anywhere near the level of completeness required for writing an actual music player program (especially since this program doesn't know how to read …

Member Avatar for JamesCherrill
-1
2K
Member Avatar for laguardian

Hello guys. I'm creating a web application on Netbeans. Under Source Packages, I've created: - DAO Factories for Customer, Inquiries, and Employee; -DB Connection to establish connectivity with a database I've created; -Entities which include Customer, Inquiries, and Employee; -Servlets containing Login, Reservations, EmployeeRegistration. I'm just wondering if my understanding …

Member Avatar for JamesCherrill
0
186
Member Avatar for mags11

Hi all. I have a program that uses a class called PersonalInformationClass. The assignment says: Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Demonstrate the class by writing a program that creates three instances of it. One …

Member Avatar for David W
0
16K
Member Avatar for Cory_1

I am writing a code that reads a user-input text file, and displays all words(excluding duplicates), and displays them in ascending order. My code runs correctly, and displays the words. The only problem are quotation marks. I uploaded a sample from a fanfiction I wrote a long time ago, and …

Member Avatar for JamesCherrill
0
595
Member Avatar for katie6580

I am trying to figure out how to print out w1 and w2 at the point it crosses like so: b l ottery a t .... and so on Here is my code. public class Assg2 { public static void main(String[] args) { String w1 = args[0]; String w2 = …

Member Avatar for JamesCherrill
0
156
Member Avatar for JoseL7

Ok, I need help finishing my homework. I do not want the answers, just hints that will take me to finish the program. I am still a begginer at java so bear with me please. This is my hmw: Write a java program to help students to calculate his/her grade. …

Member Avatar for jwenting
0
246
Member Avatar for compuser

I basically wrote a program for a phone card company, using about four classes. Im not sure what im doing wrong, but my program is not compiling. Most of my errors occur in the fourth file (class superphonecardinc) where the else if(command.equals("getLimit")) begins. Im thinking that I used too many …

Member Avatar for happygeek
0
817
Member Avatar for LibraryCode

![jframe.png](/attachments/large/4/0b8af77defcb3e49ffd02bbff7d6281f.png "align-center") Here is the jframe above,images selected at random,the task is after image is displayed,choose from jcombo the answer,press submit and display in jtextfield below the answer:"Correct" or not.And untill the submitt button is not pressed ,disable the next button.How would i do this logic? So far i have …

Member Avatar for JamesCherrill
1
755
Member Avatar for scheppy

Ok, so I have a JButton on my program and later on in the program i want to put an image on the JButton I have many buttons that start out with images on them, but Im wondering how to add images to the JButton at a later date so …

Member Avatar for JamesCherrill
0
4K
Member Avatar for alaad

Hello, I would make a full setup for my java application but I have no idea how can i make it, and I would make a class installer like in .net because I want some tasks running during the installation. Thanks for your help.

Member Avatar for alaad
0
315
Member Avatar for EarhawkPH

i have this problem about the betting system of my game. Here's the scenario: Your money: 300 Your bet: 300 JOptionPane appears: "you have insufficient money to bet" Here's the code for the main program: /* * To change this license header, choose License Headers in Project Properties. * To …

Member Avatar for JamesCherrill
0
429
Member Avatar for LibraryCode

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package my.GeographyQuiz; import java.awt.*; import javax.swing.*; /** * * @author K00190164 */ public class GeograpgyQuiz extends javax.swing.JFrame { …

Member Avatar for Traevel
0
192
Member Avatar for shayan_doust

Dear all, I was given a project to write a software that would track contracts. Everything is successful until I read or write the current data from the JTable to the textfile. This also happens when I read the textfile and insert the data into the JTable. The exception I …

Member Avatar for Traevel
0
488
Member Avatar for prakash2813

Hello all, I need help with creating grammer for Antlr that would find class, variables, methods and relationship like is-a and has-a that would be later used for generating UML class diagram. Thanks in advanced.

0
127
Member Avatar for iarpana

import java.io.*; public class testprog { public static void main(String args[]) throws IOException, InterruptedException { String command="find BEL/ -type f | wc -l"; Process p=Runtime.getRuntime().exec(command); p.waitFor(); BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); String line=reader.readLine(); while(line!=null) { System.out.println(line); line=reader.readLine(); } System.out.println("Done"); } } It's return null value. plz help me

Member Avatar for jwenting
0
241
Member Avatar for samuelmathews

John is a novice biological statistician. His first assignment given to him by his mentor, Mrs Jane, is to conduct a survey on 30 exotic plants and to note the number of flowers they produce during a period of one month. The results collected as as follows:! 0 1 1 …

Member Avatar for jwenting
-4
211
Member Avatar for shayan_doust

Dear all, I was told to write an application for my assignment that would keep track of contracts. The problem is, I have no clue how I can make this application write JTable into txt file every 5 seconds and wheever application would open, it would read the txt file …

Member Avatar for JamesCherrill
0
556
Member Avatar for Doogledude123

I have a custom class which extends JPanel and overrides the paintComponent() method. Here's what that looks like: @Override protected void paintComponent(Graphics g) { if(redrawRequested) { g.setColor(ETCH_BACKGROUND_COLOR); g.fillRect(0, 0, owner.getAppWidth(), owner.getAppHeight()); redrawRequested = false; } g.setColor(Color.BLACK); g.fillRect(pointX, pointY, PIXEL_SIZE, PIXEL_SIZE); } The same custom class also implements KeyListener. I am …

Member Avatar for JamesCherrill
0
422
Member Avatar for divinity02

hi I am trying to build this multiplication game program, well it is the same multiplication game as before. It seems to be working fine but it is not giving me the exact output. first: - when the user enter the correct answer the first time, the game stop when …

Member Avatar for JamesCherrill
0
272
Member Avatar for jamesjohnson25

There are two methods in different classes public EmployeeBean viewEmployeeByID(String EmployeeID) public EmployeeBean findByID(String id) Given, the description of each method of what it supposed to do public EmployeeBean findByID(String id) This method should use the JDBC select statements to retrieve the record based on the given Employee ID, Store …

Member Avatar for jwenting
0
351
Member Avatar for Natheesh

HI. I have been working on a 4 class program. I have some errors and would like to know what I am doing wrong. If you can help out, It would be great. Thank you! Here is a github of all my work. https://gist.github.com/anonymous/b629b37d40e017881108

Member Avatar for jwenting
0
60
Member Avatar for Muwanguzi

I'm muwanguzi lynda doing java but the way of writing a java program is aproblem,Can any one help to write 4 me a code that displays the students name,Reg.no.,course units,the marks & Grades in java.

Member Avatar for JamesCherrill
0
129

The End.