32,204 Topics

Member Avatar for
Member Avatar for RyMarr475

Hello, I'm pretty new to Java and this is my first GUI project, so try to explain like I am 5. I declare a label normally, then I set an Icon into it like this: x=rand.nextInt(4)+1; if (x==1) { computer.changeInfo("Fox McCloud", 500, 250, 100, 100, 65, 25, 15, 110, 35, …

Member Avatar for NormR1
0
1K
Member Avatar for GeekTool

Hello, i am now trying to draw a tree with stars using for loop. I find a code for this but i did not get the logic of the code. Please can anybody explain it to me ? The code is below: public class DrawingTree { public static void main(String[]args) …

Member Avatar for GeekTool
0
2K
Member Avatar for kunaldinde

i Have a problem with popup list When i type a charactor in jtextfield popup list is show popup but when i press the down arrow its cant select index of popup lists

Member Avatar for mKorbel
0
53
Member Avatar for enakta13

I am making a simple GUI program in java. In this program I have made a simple jFrame where there is two separate textField, one for user input number(data type: double) and another for square of the input number as answer. What I want is: * The event action to …

Member Avatar for mKorbel
0
805
Member Avatar for anisha.silva
0
61
Member Avatar for baig772

I am running an application in which i am running an audio when it is clicked on image, while audio is being played and i changed the mode from landscape to portrait or from portrait to landscape and click on image, it plays another audio clip i.e. 2 audios are …

Member Avatar for peter_budo
0
127
Member Avatar for Arthi.M
0
88
Member Avatar for sciwizeh

Hello, thought I'd ask before getting too deep into code to make sure I understand this properly. As described in the Gamma et. al. book the Visitor Pattern looks something like this: interface Visitor{ public void visitX(X x); public void visitY(Y y); public void visitZ(Z z); } interface Visited { …

Member Avatar for JamesCherrill
0
1K
Member Avatar for anisha.silva

hi i tried running the code below as the server: public static void main(String args[]) { DatagramSocket socket = new DatagramSocket(); //construct a datagram socket and binds it to the available port and the localhos byte[] b = new byte[32]; //creates a variable b of type byte DatagramPacket dgram; dgram …

Member Avatar for anisha.silva
0
248
Member Avatar for kunaldinde

i want to show monthly record on one pagein a jtable, when i press next page button the record in jtable shows the secound months record

Member Avatar for stultuske
0
96
Member Avatar for sajid_bd007

I have a bookstore application, but I cannot show the maximum and minimum and maximum price of the book, in the end the program. Please see my codes below. import java.util.*; public class Book{ public static void main(String args[]){ int numOfBook; double totalCost = 0; String expBookTitle = ""; double …

Member Avatar for JamesCherrill
0
169
Member Avatar for 47pirates

I want to update the contents of Jtable as shown below when the Jcombobox's item state is chaged in the left panel. but i am not being successful in it .Please help. ![untitled29](/attachments/large/2/untitled29.JPG "untitled29") when the table no value is changed in the left panel , i want corresponding Jtable …

Member Avatar for 47pirates
0
515
Member Avatar for gomonkeyninja

Okay, so this is my final assignment for a class I am taking. I'm making a Book Library Database that keeps track of all books that are entered and changed, things like that. I figured a useful feature would be saving your data in a text file so that it …

Member Avatar for gomonkeyninja
0
344
Member Avatar for GeekTool

I am trying to choose a string out of 4 strings randomly, and to show this string on the console. How can i do it ? For example, there is a question, if user answers it correctly, then the console will display one of the strings that i chose. I …

Member Avatar for GeekTool
0
205
Member Avatar for GeekTool

Hello, i want to write a program that will help an elementary school student to lean multiplication. For this, i use random object to produce two new positive one-digit integers. For this, i have coded this, but then got confused of the scope issue. Here is the code so far: …

Member Avatar for NormR1
0
156
Member Avatar for blackmagic01021

hello, I have a JAVA application for active MQ message receiving.It is based on a observer pattern. When I receive a non persistant message at my on Message functionality, it receives the same message nearly 7 times. I have a GUI where I put the messages. But as the receive …

Member Avatar for JamesCherrill
0
122
Member Avatar for kunaldinde
Member Avatar for Kert

I have 3 very simple classes and a question about their inheritance. public class A { int a; A(int a){ this.a = a; } void meetoda(){ System.out.println("a = " + a); } @Override public String toString() { return "A [a=" + a + "]"; } } public class B extends …

Member Avatar for delta_frost
0
114
Member Avatar for Ritesh_4

hello, is there currently a tool which can convert C# codes to Java (for example to be used in NetBeans)?

Member Avatar for Ritesh_4
0
387
Member Avatar for salmanomayer

Hello All, I'm facing a problem while trying to connect a SIM based modem with laptop USB port by using java. every process is almost done for how to connect. But when I'm running the application its showing the following eror msg. # A fatal error has been detected by …

0
66
Member Avatar for steven447

I use a parser called jsoup to parse html amd store it in a mysql database. The parser reads the files with an input stream. The problam is that some class en id atributes are given with class="". The parser cant find those atributes and returns a blank string. I …

Member Avatar for Shinedevil
0
152
Member Avatar for s0urce

Been working on this for so long I am lost and my mind is mush,lol. On line 106 i have this error (class camera is public, should be declared in a file named `camera.java`) I have a lot of incompatible types required: `java.lang.String found: camera.camera.string errors`. I do not know …

Member Avatar for s0urce
0
200
Member Avatar for newbie14

We have a socket connection which receive data from gps devices. The problem now is that we find some of the data coming is corrupted and therefore it disconnect the socket. The issue here we have checked the device logs files all looks fine. The engineer have implemented in C# …

0
90
Member Avatar for jonny93

Hello again. I am trying to create a simple code that can compute the average of a set of numbers read in using a scanner. import java.util.Scanner; public class Average { public static void main(String[] args) { double number = 0; double total = 0; int count = 0; Scanner …

Member Avatar for delta_frost
0
261
Member Avatar for kyriacos1986

I have created my GUI interface in Java and I would like to know how to add information from a pdf file. I would appreciate any help. Thank you in advance

Member Avatar for NormR1
0
54
Member Avatar for GeekTool
Member Avatar for StormHawk

I am trying to implement the following method: public void add (String a, b, c, d, e, f,...z) { ... } However, I get a compile time error... What am I doing wrong with this? (The parameter takes 26 strings).

Member Avatar for delta_frost
0
303
Member Avatar for Valiantangel

In my Class IntegerSet i hav declared the below method but its not printing when i ran the test public static IntegerSet union(IntegerSet setA, IntegerSet setB){ IntegerSet u = new IntegerSet(); for (int i=0;i <= CAPACITY; i++) if (a[i]==true || setB.a[i]==true) u.a[i]=true; return u; In Testing in main, `System.out.println("The union …

Member Avatar for JamesCherrill
0
130
Member Avatar for jwings

I have problems with my GUI part... I have put all components on the JFrame but I would like to add some backgrounds and decoration. However, when I add background using JLabel. Everything loses its position and they are all ruined... Is there anyway to resolve this?

Member Avatar for JamesCherrill
0
637
Member Avatar for MadJako

Hi super cool experts! Big Java noobie here and first time poster, so sorry in advance if this forum isn't for people like me. I'm trying to write a silly math program as my first user input test, but I seem to be getting error with the variables from the …

Member Avatar for MadJako
0
611

The End.