32,204 Topics
| |
I have been developing a simple java game, however I would like to add some Music to my game because it seems quite boring whenever you play it. | |
Me as one of the users in Dani web and a person who has interest in Java, I've tried to solve if not all, most of the begginers problems. I've even tried to solve some myself afterwards however, now I ran out of ideas. I would also like to move … | |
well guys, i wanted to try somethng fun in java, so i made a simple form type navigation program.. i can compile this file, bt i cant run it..NOTE: i have no issues in my java software.. import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.regex.*; public class Nav2 extends JFrame … | |
function generateHashLink($service_domain, $file_path, $url_signing_key ,$expiry_timestamp = NULL){ // + and / are some of represented chars of based64 encoding (8 bits) // + is 62 and / is 63 and these char should be replaced by other predefined chars $search_chars = array('+','/'); $replace_chars = array('-', '_'); if($file_path[0] != '/'){ $file_path … | |
My girlfriend, as confused as she is when I talk about programming, wants me to program her something. She's away on vacation to Australia right now. Of course, I told her I would program something for her in time for when she gets back. But the part that I'm stuck … | |
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"; … | |
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 … | |
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 … | |
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. … | |
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' … | |
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 … | |
I want to learn Java completely but how to start in basic to advance Helps needed | |
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) … | |
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 … | |
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 … | |
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) … | |
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? | |
Following exceptions are `Checked Exception` or `Unchecked Exception` ArrayStoreException IllegalArgumentException | |
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 | |
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 … | |
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); … | |
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 … | |
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] … | |
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 … | |
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 … | |
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 | |
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?", … | |
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? | |
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 … | |
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 … |
The End.