32,204 Topics

Member Avatar for
Member Avatar for eman 22

I want to insert an image from my hard disk into the application but unfourtantly my code doesn't work and I can't determine what causes that the image disapear.[CODE] import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.scene.text.Font; import javafx.scene.image.Image; import javafx.scene.image.ImageView; /** * @author city */ def image = Image …

0
57
Member Avatar for caswimmer2011

Hello, I am doing my first JFrame. I want it to have a button where the user clicks it and music plays. I already made the button (called b1) but i can't seem to find code for the music to be imported and played. I have tried a whole bunch …

0
123
Member Avatar for coco24

Hi, this is my first program using JUnit and I am very lost, this is the piece of code that I am running the test on [CODE] public class BoundedBag { // Data members private int[] contents; // Elements of the BoundedBag. private int topPosition; // Index of highest used …

0
78
Member Avatar for coco24

Hi, I am having problems with this piece of code and maybe I am just not understanding how to do it, but can you please help me out or give me some tips. This is the description: You will implement your BoundedBag as a partially filled array. The array contents …

Member Avatar for VernonDozier
0
2K
Member Avatar for SVW

I would like to complete a project that requires a name as a console input, but returns an output of that name in reverse. It should only use for-loops and strings/substrings. I think it needs to use an array to get it done. I am right? Below is my attempt …

Member Avatar for SVW
0
131
Member Avatar for kukuruku

Hi ,I am learning Java ,and I have problem ,when I call this method form main and chose 1 it is printing enter name and enter priority without letting me enter the data how can I fixed that Thanks [CODE] public void makeChoise(){ switch(display()) { case 1:System.out.print("Enter First and Last …

Member Avatar for Akill10
0
258
Member Avatar for curbster

Hi all, I'm almost done with a problem for a java class I'm taking. The chapter I'm studying is on inheritance and I think I understand it ok. The parent class will compile fine, but when the child class tries to compile I get an error saying it cannot find …

Member Avatar for curbster
0
463
Member Avatar for Nathan Campos

Hello, I'm building a program that gets the value of a [b]TextField[/b], concatenate with some other [b]Strings[/b] and then display them on a [b]TextBox[/b] when the [b]ScreenCommand[/b] is clicked, the problem is that it's calling a [b]NullPointerException[/b]. My code is like this(of course it has a lot more stuff): [code=java]/* …

Member Avatar for jon.kiparsky
0
199
Member Avatar for Beschatten

Hey, so I'll post what I have, the code is pretty self explanatory. I have a hunch that there are more efficient ways to code than using these long and repetitive if statements, so if you guys could help me in that direction that would be great. I also am …

Member Avatar for jon.kiparsky
0
118
Member Avatar for cozmo87

I'm reading the filenames/directories of all the files within a folder into an array of Files. The filesnames are all of the type: Name1, Name2, Name3, Name4, Name5, Name6, Name7, Name8, Name9, Name10, Name11, Name12, Name13 The above shows the correct order in which the files [B]should[/B] be ordered. However, …

Member Avatar for BestJewSinceJC
0
204
Member Avatar for nickliutw

Here is the requirements: create a class include first name, last name, and monthly salary variables. Create a set and get method for each instance variable. What is the set method for(I read the book several times)? I don't quite get how to use it. How to create a set …

Member Avatar for peter_budo
0
135
Member Avatar for BUBBLE231

Write a complete Java program that uses a loop that computes the expression m + m+1 + m+2 + ......... n-2 + n-1 + n. m and n are to be integers input from the user and should be checked for validity against the conditions 1 <= m <= n. …

0
38
Member Avatar for Sidd_

hi 2 all How to get todaz date in java and store in a string thanx in advance

Member Avatar for anuj_sharma
0
104
Member Avatar for xdrnpcx

Well i am working on a drink dispenser machine and got stuck on array part, this program includes selecting a drink, show price, show changes and a option whether to purchase drink again They are being placed on various method like public void A() select drink... public void B() calculate …

Member Avatar for xdrnpcx
0
159
Member Avatar for Abdel_eid

hello All, i am working on a small project to show people address through there names , for example the user will enter the name and it will show him the address of the entered name.. but the big issue here is that i want to googlize it which means …

Member Avatar for Abdel_eid
0
95
Member Avatar for alemojarro

I am new to java, and have this assignment do when I have to count consonants and vowels among other thigs , and I already wrote a program that works. However, I feel that there is still room for improvement specifically in the vowel and consonant counts. Could you help …

Member Avatar for alemojarro
0
198
Member Avatar for ztini

I'm having some fundamental issues with some basic abstraction. Here is the super class: [CODE] public abstract class Tile extends JLabel implements MouseListener { public Tile() { setIcon(new ImageIcon(getClass().getResource("images/blank.gif"))); } @Override public void mousePressed(MouseEvent e) { System.out.println("clicked"); switch(e.getModifiers()) { case InputEvent.BUTTON1_MASK: leftClick(); break; case InputEvent.BUTTON2_MASK: rightClick(); break; } } public …

Member Avatar for ztini
0
186
Member Avatar for ankurmawanda

am trying to connect a jsp page to a postgress database i have created a jdbcconnects.java file and compiled it with jsp_api.jar from my apache..../lib directory i have placed the class file in root/WEB-INF/classes folder the code of my class file is [CODE] import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public …

Member Avatar for ankurmawanda
0
178
Member Avatar for Jaydenn

Heres my situation: I have a server that people connect to. The server runs off the source files on a virtual private server. The files are always being updated when I edit them because they sync with dropbox and the vps. Is it bad to do this, and would it …

Member Avatar for ztini
-1
83
Member Avatar for insanely_sane

Hey guys. I'm brushing up on my GUI programming in Java and I am using the Ready to program IDE(by holtsoft). So the title tells it all really. I have tried and failed, but I need to see if there is a way to get the typewriter effect (as in, …

Member Avatar for ztini
0
163
Member Avatar for Neversleepin

Hi, here i just try to delete the content in text file between S and e letter. but i don't know to write the ReplaceAll() methode after this [CODE]String[] paras = Pattern.compile("^(S)(.*)(e)$").split(inputText);[/CODE] How could i use ReplaceAll() here? Thank you

Member Avatar for Neversleepin
0
135
Member Avatar for jemz

hello please help me how can i get the height of the tree?I really don't have idea how to get this can you help me please thank you in advance hoping for your positive response...here is my code [CODE] private Node root; public boolean isEmpty() { return root==null; } public …

Member Avatar for jemz
0
186
Member Avatar for sciprog1

Hello, I have a JFrame, inside which is a JPanel, in which I am drawing lines in the paintComponent() function at an interval of 1 second. The screen always freezes. How can I change the program below such that I can see the lines being drawn after every second? Thank …

Member Avatar for Ezzaral
0
365
Member Avatar for initialise

Hi All, I am writing a client server program that has quite a few GUI's in it. Basically, everything is working except for the problem I'm encountering. Well, obviously :P I am not currently running my server program in order to simulate what would happen to the client if the …

0
126
Member Avatar for sirlink99

This is a very simple timer and I cant seem to get it to work I have tried this () runs but does nothing: [code] // The "Timer" class. import java.applet.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Timer extends Applet implements ActionListener { // Place instance variables here …

Member Avatar for javanoob101
0
881
Member Avatar for Magekiller

Hello all, Im trying to figure out how to get the for loop for (int i = 1; i <= (11 - 2 * line); i++) { System.out.print("*"); ... to show the method listed at the bottom. I've been able to get the rest of it, just not this part. …

Member Avatar for jon.kiparsky
0
87
Member Avatar for stupidenator

Hey everyvody... I have this crazy idea for a program... I want to be able to load an image (most likely a .jpg) into a java program and then I want the program to print out the binary code that makes up the image and save it to a .txt …

Member Avatar for Urchin1111
0
468
Member Avatar for saisakthi

Hello friends, I am an android developer. I developing an application with uses the music files. For that I need javax.sound jar package. But I dont find any link to download the package. Can anybody send me a link to download javax.sound jar?

0
74
Member Avatar for newbie14

Dear All, I have one main class calling another class but I keep getting this error " SMSClient cannot be resolved to a type". Before this I tried on other pc it was ok. Below is part of the codes. What could have been wrong? [CODE]public class callSMSClient{ public static …

Member Avatar for newbie14
0
14K
Member Avatar for brynFlew

Hello, does anyone have an example of radio buttons working with a java bean. It would help out allot. Thank you

Member Avatar for brynFlew
0
277

The End.