32,199 Topics

Member Avatar for
Member Avatar for ZixCo

Hi! I'm making an app and I need to know how to set position of strings in java. Here is a code: import java.awt.*; import javax.swing.*; public class Draw extends JFrame{ JPanel panel; JLabel string; public Draw(){ super("CO-LERNER"); setSize(300,150); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); setLocationRelativeTo(null); string = new JLabel("Example"); panel.add(string); add(panel); } }

Member Avatar for JamesCherrill
0
209
Member Avatar for soujanya.bhat.184

Hi. I am learning Java and now stuck in the exceptions chapter. I wrote a code to understand exception. But i am not getting why there is an error saying "Unreachable catch block".Please help me out here. Code is as shown. public class GetException { static int i; public static …

Member Avatar for soujanya.bhat.184
0
128
Member Avatar for beforetheyknew

I'm basically wanting to design a java questionaire gui (not on java) basically just a program that holds a bunch of questions and the corresponding correct answers. So the question i would imagine i would make appear on the label and then having four possible answers a b c and …

Member Avatar for stultuske
0
822
Member Avatar for ZixCo

Hi! I need a bit of help here. I started a new project and i need to know how to set position of JLabels(strings). Can I just set pixels or use Int x = 300, Int Y = 400?? I realy need help. I will be thankful for all the …

Member Avatar for ZixCo
0
397
Member Avatar for syasya

I am beginner to Java , I would like to know is there any Difference between JDK 32 bits and 64 bits? For example in terms of performance or something ?

Member Avatar for ~s.o.s~
0
186
Member Avatar for tbuchli

/* * In a hypothetical real-estate themed board game, a player rolls two dice to *move their token around the perimeter of the board by the number of squares *shown on the face of the dice. At each spot the player lands, he or she must *take an action, either …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Zachary_1

I am relatively new to java and am having trouble using a cardlayout. When I press the button to switch cards I get a nullpointerexception but I do not understand where I could possibly have anything set to null. Any help would be greatly appreciated. This is my error... Exception …

Member Avatar for stultuske
0
330
Member Avatar for sankubha

am developing an desktop application ,for that am providing trial licence for 30 days.But if 30 days over ,if we change system date and time ,it will again back to the 30 days trial period ... how to overcome this...

Member Avatar for stultuske
0
119
Member Avatar for mikewyatt

I am trying to retrieve a blob(2) from my newly created embedded database and assign it to the image icon of a jlable (and of course save it back to the database if the image has been changed or altered). I found the following code snippit from another site but …

Member Avatar for mKorbel
0
256
Member Avatar for Allison_1

Write a program that calculates the mileage and/or cost of fuel by asking the user to input two cities. I NEED HELP. MY TEACHER DOESN'T TEACH ME ANYTHING. San Diego, CA and Houston, TX 1473.4 miles Nevada, KY and Alaska, PA 501.1 miles

Member Avatar for masijade
-2
142
Member Avatar for Start4me

Good time of day! I'm working on creating an Eulers Method Calculator program. The problem I got stuck on is I don't know how to convert the user's string into a Differential Equation (dy/dx). This is what I have so far: import static java.lang.System.*; import java.util.Scanner; class EulersMethod { public …

Member Avatar for Start4me
0
699
Member Avatar for rubeea.jaffari

I am using the C code with java code in JNI framework (Netbeans).I am getting the following error: Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\Developers\DLL_Key\MainDLL.dll: %1 is not a valid Win32 application Is there something wrong with my c compiling tools? I am using mingw-builds\x32-4.8.1-posix-dwarf-rev5

Member Avatar for rubeea.jaffari
0
78
Member Avatar for shaswata.shaha

I am a computer science graduate and want to learn web application development. I have learned HTML,CSS and JavaScript. I have knowledge of Oracle and medium knowledge of C++. Now I want to learn a server side scripting language. I am really confused what language should I learn. Personally I …

Member Avatar for nauticalmac
0
210
Member Avatar for phoenix_2000

Heya all, Right now, i'm working on a small, text-based game, but i'm a bit confused about how to get my coupeling right. at the moment, i have 5 classes: an Item class, an inventory, a player, a room and a 'game' class that loads the game. The game class …

Member Avatar for phoenix_2000
0
184
Member Avatar for Ersin
Member Avatar for stikku

I`m making a GUI for my java program using Swing Components and Netbeans IDE. My problem is that when loading a frame from another frame then newly loaded frame shows the contents of the old frame when moving mouse over the new frame.Please help me o avoid this.Am using drag …

Member Avatar for stultuske
0
95
Member Avatar for aripaka

Hi, I am a novice in .Net. Can anyone please help me by clarifying the below doubts... :cool: How can we include a client side script like Javascript or VBscript in an ASP.Net page? Can we have multiple <script> blocks in ASP.Net page?

Member Avatar for Ravi_10
0
559
Member Avatar for Vickyurs86

Hello All, I would like learn Java from basics as I am not from IT Domain. Its a new platform me but I have some great oppurtunity if I will learn Java. Please let me know the best way to learn Java for Non-IT Domain. Please note that I have …

Member Avatar for ObSys
0
140
Member Avatar for Allison_1

Task: Write a program that calculates the mileage and/or cost of fuel by asking the user to input two cities. It only works for two places and not all three, why? How can I put just the name of the location instead of inputting the numbers? package Winterproject; import java.lang.Math; …

Member Avatar for JamesCherrill
0
330
Member Avatar for simran_4

Hello all, I am stuck with a nullpointerException at line 41 and 60.Can someone please help me out.any kind of help will be appreciated. Thanks import javax.swing.*; import javax.swing.event.*; import java.awt.Color; import java.awt.*; class calenders extends JFrame { int i=0; int j=0; int k=0; JFrame jf; FlowLayout fl; JPanel jp[]; …

Member Avatar for simran_4
0
563
Member Avatar for scheppy

Hi all. Im having trouble getting my menu to work on my window. this is what I have so far as for my code. package sparepartinventory; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.*; /** * * @author jonathan */ public class SparePartInventory { /** * @param args the command line arguments …

Member Avatar for JamesCherrill
0
277
Member Avatar for godzab

Hello all, I am trying to find all occurences of a letter in a word. If the letter is present in the word, then I save it to a String. For example here is the text: Hello World, my name is godzab. I search the text, and if there is …

Member Avatar for godzab
0
106
Member Avatar for ronnel09_2

Please help me with this, i'm trying to create a domino game (which a project in school) i'm a midway learner of Java Prog, but still i haven't know a lot. My problem is, i'm trying to draw over the background image of my playFrame, but the rectangle does not …

Member Avatar for ronnel09_2
0
185
Member Avatar for shchandhu

i started learing java reading thinking in java i cam across this java objects do not have same lifetime as primitives an object retains in memory even after its scope until garbage collector detects and releases the memory well whats the lifetime of primitives..?? their memory will be released after …

Member Avatar for JamesCherrill
0
125
Member Avatar for sciwizeh

Ok, so I'm working on a web-project, I connected a custom hanlder to the root Logger in `contextInitialized()` of a ServletContextListener: @Override public void contextInitialized(ServletContextEvent sce) { Logger def = Logger.getLogger(""); Handler hand = new DatabaseLoggingHandler(); hand.setLevel(Level.WARNING); def.addHandler(hand); } which looks like: import java.io.PrintWriter; import java.io.StringWriter; import java.util.logging.LogRecord; import java.util.logging.Logger; …

0
253
Member Avatar for nikolaos

/* PointOne type objects has three members. Two of type Integer and one of type ThreeD a custom class. PointOneClone method takes an argument of PointOne type and copy every value from his members to arguments members. So the result is a PointOne instance with the exact same values but …

Member Avatar for JamesCherrill
0
207
Member Avatar for Twee Nguyen

Hello everyone, I just start to study about Java and I need to design a website in Java. I do not know I should create a Java Application project or Java Web or Java EE.... Could you help me to start this? Thank you.

Member Avatar for peter_budo
0
246
Member Avatar for x2005man

hi geys , I need ow to return a array string to my method public String[] SearchPort(){ ArrayList<String> arr=new ArrayList<>(); Win32Driver w32Driver= new Win32Driver(); w32Driver.initialize(); port= CommPortIdentifier.getPortIdentifiers(); while(port.hasMoreElements()){ cuport=(CommPortIdentifier) port.nextElement(); if(cuport.getPortType()==CommPortIdentifier.PORT_SERIAL){ // return cuport.getName(); arr.add(cuport.getName()); String[] t=new String[arr.size()]; t=arr.toArray(t); for(String j:t){ return t; } } //System.out.println(cuport.getName()); } String h[]={"noo data …

Member Avatar for stultuske
0
119
Member Avatar for xtreamcoder

I have good knowledge of C, and a good knowledge of core Java. Please list out the areas I need to cover for J2EE. There are many technology available in j2ee.. Please tel me which technology is using uptodate.. I have premium account in lynda, vtc, and pluralaight.. There many …

Member Avatar for stultuske
0
244
Member Avatar for CoilFyzx

Good day folks. Problem: My program needs to import data from a database and display them in a table then manipulate and display the data in various ways. That bit is solved the next part is where I need help. The program then needs to save locally... 1. the newly …

Member Avatar for CoilFyzx
0
399

The End.