3,978 Topics

Member Avatar for
Member Avatar for vinnitro

This is my ScreenManager class which is used for getting the perfect DisplayMode & setting the screen to fullscreen import java.awt.*; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.lang.reflect.InvocationTargetException; import javax.swing.JFrame; public class ScreenManager { private GraphicsDevice vc; //give vc access to monitor screen public ScreenManager() { GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); vc …

Member Avatar for vinnitro
0
283
Member Avatar for christine.dunne.963

I tried using BorderLayout as in label but does not work package HelloWorldGUI; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class HelloWorldGui { private JFrame a; private JPanel p; private JButton b1; private JLabel lab; public HelloWorldGui() { gui(); } public void gui() { a = new JFrame("window"); a.setVisible(true); a.setSize …

Member Avatar for scudzilla
0
127
Member Avatar for murali2489

Hi All, I have a doubt in paint method of the Component Class. I know how to use that in Applet but im finding it hard to use it in GUI app. Im posting my code here, please edit it to make the program use paint method to render any …

Member Avatar for JamesCherrill
0
339
Member Avatar for JoeD1

I created a String[][] grades, who's size is set by number of students User enters. The array is then populated with my first for loop, and the next for loop is supposed to print out each students date line by line. If I only enter 1 Student and fill in …

Member Avatar for stultuske
0
282
Member Avatar for gauravagg2

HI!!!! i am a student of B.Tech 3rd year plz suggest me a mini project in java i have basic knowledge of swing and jdbc and elementary idea of networking

Member Avatar for JamesCherrill
0
558
Member Avatar for mgold

Sorry if this is the wrong place or something, but I saw a question in here on PHP vs ASP.NET, which made me think it might be. On the other hand, I also saw posts asking about people's breakfast, so I don't really know... Users are already starting to embrace …

Member Avatar for james.lu.75491856
0
454
Member Avatar for Wolfenstien

Hi! Im new to Java and iv been studying GUI's in it. Just started with swing and tried to make this giu for a calcularot. but it doesnt execute and gives me "java.lang.NoClassDefFoundError" error. im a total noob so i cant figure it out. i'd really appreciate it someone could …

Member Avatar for Wolfenstien
0
273
Member Avatar for DavidKroukamp

I have recently been interested in Java Swing and Game development, so naturally I began creating many different 2D games. During them I found myself having to rewrite much code, but eventually I decided to write some classes that would help me whenever I wanted to make a game. Here …

Member Avatar for JamesCherrill
3
2K
Member Avatar for somjit{}

[this](http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TextComponentDemoProject/src/components/TextComponentDemo.java) is the code i was looking at.Its about how to use JTextPane and related swing text Components along with actions and keymaps. my question is that in this part textPane = new JTextPane(); textPane.setCaretPosition(0); textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc …

Member Avatar for somjit{}
0
222
Member Avatar for Deve

**Bold Text Here** hey any one can help me sort out my problem.. when i enter the customer id then in tabular format i want its all detail. how to do.. like in textBox i enter customer id as 1 then pressed ok button then in new frame or in …

Member Avatar for peter_budo
0
248
Member Avatar for vehement66

[CODE]import java.util.* public class ArrayMinMax { public static void main(String[] args) { Integer[] numbers={8,2,6,7,1,4,9,5,3}; int min=(int)Collections.min(Arrays.asList(numbers)); int max=(int)Collections.max(Arrays.asList(numbers)); System.out.println("Min number: "+min); System.out.println("Max number: "+max); } }[/CODE] Hi guys, me again. Okay so I use this code in a single array if i want to know what the minimum and maximum …

Member Avatar for jwenting
0
5K
Member Avatar for james12James12

HI I have been building a game applet. I have coded as far as getting rectangles to move on a timer and put integers into the rectangles. I am not familar with how to click the rectangles and I also want to get the different numbers going through an ArrayList …

Member Avatar for jwenting
0
260
Member Avatar for Huang xiao

Hi, I am making a simple game,this is my first time to develop java game,but i think i am lost in my code,i could not display or show my bullet when i pressed arrow up,can you help me please how can i achieve on this. here is my simple code. …

Member Avatar for JamesCherrill
0
189
Member Avatar for stefanienikole

I am having trouble with the last three methods of my program in the **Board.java**. I'm not sure how to go get it to read gameBoard. It keeps giving me errors. I really cant figure out what I'm doing wrong. All the methods were given to me and cannot be …

Member Avatar for jwenting
0
817
Member Avatar for vishalonne

I am using Netbeans 7.1 and MySQL. I need 1 column in jtable which will contain jradiobutton and user can select any 1 row's jradiobutton Please refer the fig for detail. After selecting RB further processing will be done on jbutton click event. ![64496cca6997d07cf995950d67a3e3f0](/attachments/large/2/64496cca6997d07cf995950d67a3e3f0.JPG "64496cca6997d07cf995950d67a3e3f0") Here is the code - …

Member Avatar for mKorbel
0
346
Member Avatar for vani krishnan

We use to import packages in java like import java.util.*; import java.lang.*; import javax.swing.*; But, why is it javax for swing?

Member Avatar for jwenting
0
198
Member Avatar for wolwayne

I have one tab by default (tab1) New tabs are generated , equal to 'No of rooms'. The dynamically generated tabs have same structure as of the default tab. I don't know the name of textfields of newly generated tabs. How can I find the name of jtexfields generated on …

Member Avatar for mKorbel
0
425
Member Avatar for sash_kp

import java.awt.*; import javax.swing.*; JPanel middlePanel = new JPanel(); middlePanel.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagContraints(); cons.weightx = 1.0; cons.weighty = 1.0; middlePanel.setBorder(new TitledBorder(new EtchedBorder(),"Display Area")); When i use this code snippet(this is just a rough code snippet) i get errors like "can not find symbol GridBagContraints" and "can not …

Member Avatar for JamesCherrill
0
176
Member Avatar for incxx

My program is a math game which consists of different levels and different math operations. I'm not completely finished yet but I would like to know if there is a way to put the code for each of the four operators into their own method, and just have the main …

Member Avatar for JamesCherrill
0
211
Member Avatar for jemz

Hi, I need some help on this how can i use the arrow keys(up,down,left and right) in the keyboard so that the filloval will move, I have no idea on this.can you help me on this please. Thank you in advance. import java.util.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public …

Member Avatar for jemz
0
1K
Member Avatar for DrEinstein

Hi everyone, I'm stuck making a Scroll pane to see all the bar graphs created when they do not fit on screen, or when the frame is diminished. Can anyone tell me how to do this please? Thanks import javax.swing.JFrame; import javax.swing.JOptionPane; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.awt.*; …

Member Avatar for DrEinstein
1
149
Member Avatar for DrEinstein

Hi everyone, Does anyone have an idea of how to skip a line in a JTextField? In System.out.println, I would normally type n but it didn't work for me when I used it in a textfield: text1.setText(**"n"**+coloumn[counter]); where the output displays well as desired excpet that it doesn't skip a …

Member Avatar for DrEinstein
1
676
Member Avatar for Xantipius

For the hundredth time I'm listening to **Blackstone Legacy** album (1971) by Afro-American jazz trumpeter Woody Shaw (1944-1989) and I like it exclusively. What kind of music I **don't** like is any sentimental music, so called "smooth" jazz, swing (in the 21st century it sounds too moth-eaten), 99.999% of rock …

Member Avatar for 45hot45
0
324
Member Avatar for cheesy_ninja45

I'm trying to make this work, and I keep getting errors, can someone fix it and show me what's wrong? I've been trying to fix this for a few days and I can't. Thanks in advance. import java.awt.*; import java.applet.*; import java.util.*; import java.awt.event.*; import javax.swing.*; public class FrameX extends …

Member Avatar for stultuske
0
231
Member Avatar for modesto916

Hello, My teacher asked us to write a little O.S simulator, my group has to write the file system module. We are using contiguous block alocation for the files, we would like to represent the utilization of the blocks using a colored matrix, where the used blocks would be red …

Member Avatar for modesto916
0
144
Member Avatar for james12James12

Tryin to sort a search method for abit of code. Have an array list reading from a csv. Any help on how I can get a search method searching through and displaying onto a jTextArea? This is my code in my Gui public class DataGUI extends javax.swing.JFrame { public class …

Member Avatar for stultuske
0
301
Member Avatar for Jasonfran

Hello, I have created a GUI using the Netbeans GUI Builder and I have a JTextArea that I want to output to, but because I need to use threads I am doing a lot of processing in an external thread. I am having issues outputting data from the thread class …

Member Avatar for stultuske
0
2K
Member Avatar for Tango2010

Hi, I wonder if anyone can possibly help. I am trying to teach myself how to integrate a Java video into a Java GUI / Swing Application. I am pretty competent with building Java graphical user interfaces and the background Java application code, however I am puzzled with how difficult …

Member Avatar for nvrandow
0
481
Member Avatar for timi_ca

Im new to java swing, and Ive got a little problem. So I've got a class Flight.java. In there I have a method displaySeat2D(). First I had this done with the scanner. Now I have to use swing. So basically I made text fields to take in number of rows …

Member Avatar for timi_ca
0
2K
Member Avatar for salomonsk8

Hello all, So I have been scouring the internet trying to find an answer to my question. I usually never have to post a question because someone somewhere has asked it, but I guess there is a first for everything. I am a VERY intro level, brand spankin new 'programmer' …

Member Avatar for salomonsk8
0
519
Member Avatar for dragonofspam

I need some help figuring out where I have gone wrong on my program. It is a classic classroom program, where the program creates a random number and gives high, low response untill the user enters the correct number. I have the GUI working and I know the action to …

Member Avatar for stultuske
0
328
Member Avatar for mKorbel

- Please how is possible (probably dirty hack) to create [How to Create Translucent and Shaped Windows](http://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html) - undecorated container (returns *java.awt.IllegalComponentStateException: The frame is displayable.*) - change Look and Feel for (returns *AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated*) - by using code from linked official tutorial . import java.awt.*; …

Member Avatar for mKorbel
1
1K
Member Avatar for Dane2259

I'm trying to create a multiple choice quiz, and I need the content pane to scroll. If you run the program I've attached you'll see what I mean. Each question and the answers are place in a JPanel and the JPanels are place on the content pane. Thanks in advance …

Member Avatar for mKorbel
0
132
Member Avatar for Bhavya scripted

hey all I was watching a tutorial on java game development.In that video,the guy was making a window a on the screen,then making an oval,then moving it. His code worked fine and i am 100% sure that my code is similar to his(i checked it a few times). What my …

Member Avatar for Ezzaral
0
323
Member Avatar for Ralphael

I have a project I am working on and it involves java graphics which I am a novice at, I have uploaded the description of the project and the image of how it should look like, now i am having problems implementing the part of introducing the virus and drug …

Member Avatar for robin.litsetorp
0
244
Member Avatar for overwraith

I have been having some trouble with this action listener scenareo, and I am doing it exactly like what my java book says to do, and something is still not working. In the action listener the if statement is not working correctly. Here is an example of my code. The …

Member Avatar for overwraith
0
177
Member Avatar for maxcatozzi

Hey, Does anyone see anything wrong with this? I don't know what's up, it's throwing the IOException everyt time even though the mp3 is in the source folder. (I tried .wav as well). I'm trying to place this in a GUI, but testing it seperately first. import java.io.*; import sun.audio.*; …

Member Avatar for stultuske
0
1K
Member Avatar for parkz16

there are no visible error in the syntax but when i run the application i keep getting the following error. i have been trying to fix it for hours and simply cant find the problem. the error that appears when running is; Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.JComboBox.setModel(JComboBox.java:292) at …

Member Avatar for bguild
0
33K
Member Avatar for Neon Tetras

I'm working on a Grade Point Average Calculator. The user just have to Select the number of courses offered, then select the grade obtain in the different courses by choosing the appropriate grade from the Choice Box. The problem with my application is that, if the user mistakenly selects "A" …

Member Avatar for Neon Tetras
1
169
Member Avatar for mjbor1

hello i am working on a simple panting project that allow the user to select a shap from ComboBox then draw it on the panel but problem is when is choose any type of shapes and drawing it on panel no shape appear on the panel ?! here is my …

Member Avatar for mjbor1
0
310
Member Avatar for andymarin

Hi guys, I'm having trouble with my code and I'm kind of new in Java so I don't know what to do. I have to do a program with Buttons and each button has to take me to another class (I don't know if I'm being clear). For example if …

Member Avatar for andymarin
0
709
Member Avatar for wolwayne

I am making an examination system desktop application in Java Swing. I have a frame named 'show_class_question' frame. This frame is used to display questions and four options from database. Whenever user clicks 'Next' button I am calling this same frame (show_class_question) again and agian from itself (self - refrencing) …

Member Avatar for stultuske
0
408
Member Avatar for Gruff

Alright so I am still kinda new to java I am working on a lottery program that will ask the user how many tickets they would like (default being five) and each ticket has a random set of numbers plus a jackpot number: this is the code have so far... …

Member Avatar for JamesCherrill
0
134
Member Avatar for joseph.lyons.754

Hey Guys, I am working on a search that takes in a value via textfield. Once taken in it should display another Jframe with the info but the searchbox crashes the second I run it. Its some stupid mistake I have made or i have gone about it the wrong …

Member Avatar for JamesCherrill
0
379
Member Avatar for trishtren

Hello, I was hoping someone can help me, im looking for a way to extend a basic shape class in particular the roundedrectangle2d class and be able to draw it in the same way we could handle an object with a simple call to g.draw(object instance); However im having problems …

Member Avatar for JamesCherrill
0
383
Member Avatar for game06

i am trying to put a java japplet on website. when i run in eclipse it works fine but when i run on website then i get a error: error: on website CacheEntry[http://localhost/eCommerce/menu_pages/game_pages/java_game_3/Main.class]: updateAvailable=true,lastModified=Fri Apr 26 20:39:42 EDT 2013,length=10508 CacheEntry[http://localhost/eCommerce/menu_pages/game_pages/java_game_3/Main$Display.class]: updateAvailable=true,lastModified=Fri Apr 26 20:39:42 EDT 2013,length=2489 Exception in thread "AWT-EventQueue-2" …

0
99
Member Avatar for peymankop

Hi...! i'm working on a notepad project but i've got a problem in undo action this is my code: import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import java.io.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; import javax.swing.JLabel; import javax.swing.SwingConstants; import javax.swing.undo.*; public class Notepad …

Member Avatar for stultuske
0
384
Member Avatar for j.t.casperson

Ok, so here I have a program that creates two boxes. The top box should start out with all 12 months of the year in it. What I'm trying to have happen is be able to move the months (through the two buttons) back and forth. Originally it just had …

Member Avatar for stultuske
0
138
Member Avatar for modesto916

Hi there, I'm just starting with Java and Desktop programming but I have some doubts, for example: You are going to write a new application, you go there, draw your ER for your database, UML, etc. My problems is when I need to integrate the interface with the program logic, …

Member Avatar for stultuske
0
209
Member Avatar for sim_pack

i have this code to render a locally saved html file onto a jframe. i have the following problems with how the html was rendered: 1. the texts of the 'webpage' do not wrap; 2. in order to solve my problem in 1. above, i added a JScrollPane, problem is, …

Member Avatar for sim_pack
0
570

The End.