32,199 Topics
| |
Hi! There is JPanel with multiple JLabel components. I would like to change the border color of JLabel component that is clicked on. I tried [ICODE]this.getComponentAt(e.getX(), e.getY()).setBorder(solidBorder)[/ICODE], but it did not work... How could I solve this task? | |
Hello, I'm getting quite flustered with this program and the errors are starting to get harder to debug. This is my tree.java file: [CODE]package TreePkg; import java.io.FileNotFoundException; import java.lang.SecurityException; import java.util.Scanner; import java.util.NoSuchElementException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.Serializable; import java.io.EOFException; class TreeNode<T extends Comparable <T>> … | |
Why do they release their own version? Also why don't they allow Java on their portable devices? I'm looking for their specific reason, something besides "Apple are Nazis". | |
Hi! I'm trying to add dragging and dropping behaviour to JLabel. It works only when I press the mouse for the first time. If I continue pressing the mouse, the error message shown below is generated. Please, help me to find an error. [CODE] JLabel bkg = new JLabel(icon); jLayeredPane.add(bkg, … | |
Hey, I've never really used packages before so I was wondering if what I am doing is possible. i have a package called spacewars with all my classes. I then created another package from that called spacewars.resources. I am not sure what the best way to access those resources is. … | |
Hi all, I just got started using JasperReports and I'm intially stuck on this parameter problem. I have a report which is just a list of cities and the country they belong to. I would like to create a list/dropdown parameter so that when the report is run a unique … | |
Hello Members, I have a Class_A which extends a JPanel. This JPanel is inside of a JFrame. In Class_A, I have a series of images (stored in an ImageIcon array) and another image, let's call it Image_A, which is also a ImageIcon type. How do I make Image_A a background … | |
hey everybody I have problem with my program which is I couldn't do text scrolling correctly I open text file from the user then put it in text area after that the user will press start button to auto scrolling , i road the file line by line and stored … | |
I have a buying system set up in one class (the Right Panel class) and it's working great, but my text field for displaying money available is in the Left Panel class. When I click the buy button, it should subtract from the money amount and re-display the new money … | |
Please help me..I need to fix my array. This is from my instructor..Your program compiled and ran well. It implemented all of the requirements for the assignment. You have a separate class that stores your Product, and your products are stored in arrays. You also implemented methods to sort the … | |
Hi! I would like to zoom in & zoom out an image in JLayeredPane. Now I have a snippet for loading a background image into JLayeredPane. How could I now access ALL content images of JLayeredPane (it could contain multiple images) and zoom them in/out? Perhaps, somebody could send me … | |
Why won't this work? I'm trying to make a ball appear and move along my screen but it's failing :'( . I'm :( and also trying to make it so when you press any key it restores the full screen but that's also failing. :'( Can anyone help? [CODE]import javax.swing.*; … | |
Hi, I'm a bit stumped. I'm trying to find out a way to make a bullet fly from a spaceship. So far, I managed to make it work but it attaches onto the coord's of my ship image(I used the position of this to map the starting position of my … | |
Hello, I'm having little trouble solving this question correctly. first of all, I keep failing at testing most of these methods, and I don't know where did i go wrong for them not to work. thus, i'm not able to know if it's solved correctly or not. Question is: 1.CountNumbers … | |
Hi guys, I'm trying to create a 2D array of JLabels my first problem is actually creating them. my code atm is = [CODE] package test; import java.io.File; import javax.swing.JLabel; import javax.swing.JPanel; public class testing extends javax.swing.JFrame { /** Creates new form testing */ public testing() { initComponents(); for(int i … | |
I'm doing a java project where one of it's parts is to add college courses to an arraylist. This college courses has their class code like ccom 3001, how many credits does that class have and the complete name of the course, like Programming I etc. The only thing I … | |
I'm trying to complete the good old Knight's tour (Knight piece must touch every square on board without touching a square twice. My code goes all the way to the point where the knight is at a dead end, and I need to revisit the last stack... How do you … | |
Hellooo guys could any one help me pllz i have a final exam tmw :( and the exam is Write a program that read 5 integers numbers and print the largest and smallest numbers By using IF statements :( | |
I am using JSF with trinidad. I need a popup on click of a commandLink. But the pop up doesnt work..i,e it doesnt open in the browser. The popup blocker if off and I have also reset the browser settings. Also the same problem exists with <h:outputLink value="javascript:popupWindow('watchList.jsp')"> <tr:image source="#{msgs.editImg}" … | |
How to get one answer from a set of answers may not be the best and print it? | |
Write a java program that read 2 integers numbers, Then determines and prints if the first is a multiple(double) of the second NOTE : Using if and else statements - and use the modulus ( the percentage mark ) to answer the question this is my answer !! pllz if … | |
Can anyone give me the steps to changing my default color scheme for Eclipse.. I mean changing the editor background, keywords etc. DONT post links if your trying to help, ive been on google for the last hour its useless. Thanks if you can help | |
Hello, i am having with my mastermind game. I try to display black and white pegs but it does not work. Right now i gave up on black pegs and i am trying whitepegs. [CODE]import java.io.*; import java.io.*; public class Mastermind { int a = 0; int p = 0; … | |
Hi there, Every time i am making a program in Java(Advance). I found that it can many errors in it. For example I am Giving u a program written by me //a push button with all features [code] import java.awt.*; import javax.swing.*; import javax.swing.border.*; class Mybuttons1 extends Frame { //vars … | |
Java Desktop DATABASE App SE (Like Phone Book App) I want extract data from a Database Table and, each output line has a radio button, to get edited/deleted the corresponding record by pressing corresponding button at end or results... well any sight/tip? Basically how dynamically to create radio buttons? What … | |
i'm trying to come up with an add method for a generic class i created. generally the object i create will be arrays, of type integer double or string. i dont know how to go about making the add method to have stuff added to the array... heres my code … | |
I know you can, [CODE]frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);[/CODE] but is there a way to get it to execute a method and then exit? example.. [CODE]frame.setDefaultCloseOperation(saveData, JFrame.EXIT_ON_CLOSE);[/CODE] just a guess? thanks all | |
Hello all! I am trying to create a server - client bundle that will let me send simple messages with ssl support. I am quite new at java and i can't figure out what my problem is. I am running the server and client programs at 2 computers at the … | |
Hi, I am pretty sure there is a more effective way of achieving this. Would love for some input from you guys. Basically, I have a class called GamePanel and it contains this: [CODE] SpaceShip spaceship = new SpaceShip("Galatar"); public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.drawImage(bgI,0,0,null); … | |
Hey all, I need some help on this program cause I'm stumped. Everytime I compile this program is gives me an error of either "cannot find symbol" or "int cannot be dereferenced". I'm still playing around with the code but I might have to put the other class in a … |
The End.