32,199 Topics

Member Avatar for
Member Avatar for xxwikkixx

I am trying to send some strings on my android device using bluetooth to my arduino so I am wondering if my logic is correct for my code. The part I am stuck on how to implement if all arguements are OK then it should send String temp = "t"; …

Member Avatar for Taywin
0
257
Member Avatar for funnym3

Hi guys, I'm new here and I have a activity in my java class. my instructor want to sort all the given names after they added to the list. can you guys help me with it? thanks here's my code: import java.util.*; public class Test{ public static void main (String …

Member Avatar for funnym3
0
131
Member Avatar for Violet_82

Hi all, I started to look into event handlers, and there is something I would like to ask, sorry if this is a silly one. I can see that different Java components generate different events when the user interacts with them, but when it comes down to 1)which interface the …

Member Avatar for Violet_82
0
302
Member Avatar for anand01

Hi all, I have employee class which I have 100 variables with getters and setters. now I am passing employee object to processing method. Now I want to read all values in processing method. Should I want to use getter for all member? Is there any way to achieve this. …

Member Avatar for JamesCherrill
0
289
Member Avatar for reuben_1

Hi there, I would like to make a basic plugin with a /hello command that when types outputs "Hello, user!" or there minecraft user name I have done all the code, and I have a problem of which the server says: [16:02:10 ERROR]: Could not load 'plugins/GreetingsPlugin.jar' in folder 'plugins' …

Member Avatar for stultuske
0
92
Member Avatar for Richa_2

interface Data { public void load(); } abstract class Info { public abstract void load(); } public class Employee extends Info implements Data { public void load (){ System.out.println ("loading"); /*do something*/ } } Why this code is correct ? Is it is not compulsory to deine the method declared …

Member Avatar for stultuske
0
307
Member Avatar for dwel
Member Avatar for chdboy

This is the code void CreateGUI() { try { //myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); //myPicture = ImageIO.read(getClass().getResource("Companylogo_FINAL.jpg")); /*java.net.URL u = getClass().getResource("/resources/Companylogo_FINAL.jpg"); System.out.println(u); myPicture = ImageIO.read(u);*/ /*try {*/ //myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); /*} catch (IOException e) { }*/ ImageIcon img = new ImageIcon(myPicture); //frame.setIconImage(img.getImage()); } catch (IOException e1) …

Member Avatar for chdboy
0
480
Member Avatar for chdboy

Here is the error I'm getting Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: input == null! And here is the code try { //myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); myPicture = ImageIO.read(getClass().getResource("/resources/Companylogo_FINAL.jpg")); ImageIcon img = new ImageIcon(myPicture); frame.setIconImage(img.getImage()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } JLabel lbl = new …

Member Avatar for chdboy
0
2K
Member Avatar for johnson_2

1. I created three JLabels(one,two,three) and add a mouselistener to it. 2. For every even turns, the program will allow me to click any of the JLabels **once** and print out the JLabel I have clicked. My program is throwing me the following errors Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java …

Member Avatar for johnson_2
0
272
Member Avatar for moaz.amin.37

if a program throw 2 exceptions can we handled it by user defined exception.for example import java.util.*; class WrongException extends Exception{ public WrongException(String s){ super(s); } } public class UserDefinedException2{ public static void main(String s[]){ int a,b; a=b=0; Scanner ob=new Scanner(System.in); System.out.print("Enter your age = "); a=ob.nextInt(); try { if(a<=0) …

Member Avatar for JamesCherrill
0
253
Member Avatar for didi1111

i have a jframe JFrame f = new JFrame(); f.setvisible(true); I want when I open this frame it play a sound what can I do in java?

Member Avatar for Hiroshe
0
53
Member Avatar for moaz.amin.37

Following exceptions are `Checked Exception` or `Unchecked Exception` ArrayStoreException IllegalArgumentException

Member Avatar for JamesCherrill
0
288
Member Avatar for moaz.amin.37

exception is a run time error,then why exceptions are again classified into compile time exception and run time exception,in that case it should be run time exceptions only.please give explanation with suitable real time example

Member Avatar for moaz.amin.37
-1
329
Member Avatar for Slavi

So, basically I tried to do everything i found to fix this but nothing really worked .. (It works fine on my 32 bit pc using elementary os(Luna linux). However my laptop has Kali Linux 64 bit. I have chromium installed. Some of the things that I tried which worked …

Member Avatar for Slavi
0
174
Member Avatar for chdboy

import java.awt.Frame; import java.awt.SplashScreen; import javax.swing.JOptionPane; public class NewFrame extends Frame { public NewFrame() { // TODO Auto-generated constructor stub SplashScreen splash = new SplashScreen(1000); System.out.println("This is working"); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //SplashScreen splash = new SplashScreen(2000); …

Member Avatar for JamesCherrill
0
299
Member Avatar for screenedcreamy

I've been programming in java for almost 5 years now. I'm self-taught, so while I know how to program, I don't know some of the more formal aspects of computer science. So if i were to brush up my knowlegde on algorithms and data structures using java which books can …

Member Avatar for screenedcreamy
0
231
Member Avatar for brittney_2

I don't have a code that needs solving, but merely a simple explanation if possible from an example in a book. There isn't much explaining and I just need to know how this line of code checks to make sure the date entered does not occur in April. The [0-35-9] …

Member Avatar for brittney_2
0
210
Member Avatar for moaz.amin.37

i am confuse about `paint()` method in applet .The confusion is that paint method is getting object as parameter of Graphics class like this `public void paint(Graphics g)` and i read that the Graphics class is an abstract class then how we create object of Graphics class and now you …

Member Avatar for JamesCherrill
0
377
Member Avatar for samuel.tenderfeet

I recently submitted an assignment to my instructor, and i got a less than desirable grade and the jist of the marks were that iw as using hard coded variables so can someone explain to me how to use the getter method a little better? (i assume thats what i …

Member Avatar for stultuske
0
145
Member Avatar for abeer araji

thanks all for help im new in the website and i dont even know how to use it well im not a cheater or any thing else and i will not copy past any thing !! Im here just to learn

Member Avatar for JeffGrigg
0
134
Member Avatar for Violet_82

Hi guys, I run into a problem. I am trying to write a small program. There should be 4 radio buttons and each of them controls the colour of the Content Pane. The problem I have is with the anonymous inner class (I hear JamesCherrill muttering "why do you bother?", …

Member Avatar for JamesCherrill
0
295
Member Avatar for Jack_9

In my opinion, c# is better then java. Espicially because it runs upon the .NET framework. But java can run on virtually any device. They re both alot alike, so which one would be better to learn?

Member Avatar for ChrisHunter
-1
235
Member Avatar for asaidi

Hi i m using my host to save mysql database.. when i fill the fields the data is saved ..but i m keeping getting this error ..and really the data input is saved i dont understand why.. the error i get thank you in advance com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The …

Member Avatar for asaidi
0
299
Member Avatar for monkeybut

I am creating an AlertDialog that I can enter a new value into a SQLite database. The Insert method works if I call it by itself in the onCreate() method, but when I try to call the method in the setPositiveButton onclick listener it doesn't work, it gives me a …

Member Avatar for monkeybut
0
1K
Member Avatar for rowen_1

Requirements 1. the user clicks the button(Go to animation page) at page one 2. the user will be directed to page two whereby an animation is played for 5 seconds 3. after 5 seconds, the user will be directed to page three. I am trying to delay a page for …

Member Avatar for JamesCherrill
0
182
Member Avatar for Steven_9

I am currently taking java and learning how to create GUI. I am trying to create a GUI whereby 1) Upon executing the application,the user will need to key in his username and password. 2) the user will be brought to second page which displays "Welcome to Page Two!" if …

Member Avatar for Steven_9
0
2K
Member Avatar for soujanya.bhat.184

Hi Guys, How to write the contents of JList into a text file. i have a JList and i want to add the list elements to a text file. How to do this?

Member Avatar for stultuske
0
278
Member Avatar for abeer araji

1. Write a program that asks the user to enter five integers and then adds and outputs the sum of odd integers, and adds and outputs the sum of even integers. For example, if the user enters the integers 7, 4, 2, 1, and 3 then the program should output …

Member Avatar for stultuske
-1
174
Member Avatar for mgold

I love the idea of dependency injection. I started doing psuedo dependency injection on my own before I knew about DI because I was frustrated programming without it. I then discovered Guice. From a program design point of view, I like it a lot. Everything is much more decoupled and …

Member Avatar for JeffGrigg
1
292

The End.