3,978 Topics
![]() | |
Right so I have a pretty simple code that draws the contents of a 2D array onto a panel and the panel is placed onto a frame. The array is of type String and just houses a number of different fruit. The problem is that when the contents is painted … | |
Hello! I have a problem with filtering JTable (AbstractTableModel)... So, this is my code: [CODE] //Create table and filter public TableRowSorter<MyTableModel> sorter; public static MyTableModel tableModel; ... //Define table and fill it with List "userDataList" List<UserDataRow> userDataList = readuserdatafromfile(); filetree.Form.tableDetails = new JTable(); tableModel = new MyTableModel( userDataList ); filetree.Form.tableDetails.setModel(tableModel); … | |
ok.i have a problem in displaying the images into a jlabel.. the images is stored in mysql database and i used blob as its datatype.. my program is like a search engine.. when the user search for a keyword and click the search button it will show another class which … | |
Hey guys, I have tried for 3 days now, tried so many forums but help, but still i cannot get the help. I need help from this forum, because i have heard the members are very smart. Basicaly i have a code for a game. The point is that the … | |
hi, im new to java and am trying to create a simple paint program, what i'm having difficulty with at the moment is creating a field that will remember the current shape the user has chosen, i really don't know too much about what i'm doing more trial and error … ![]() | |
Can someone work with me on this program. I will put the instructions first, then my code, then the errors [B]INSTRUCTIONS: [/B] Create a program to enter grades and calculate averages and letter grades. 1. Need a class which will contain: a. Student Name b. Student Grades (an array of … | |
I have been working with my final project for about 3 weeks now and its due by 10am tuesday. Currently I am receiveing cannot find symbol errors. I know this is something simple. Please help. [B]INSTRUCTIONS[/B] Create a program to enter grades and calculate averages and letter grades. 1. Need … | |
Once again, I found some code that seems to be doing something that I would like to try, but I get a Static Error when I try to run the code (apparently, I may be the only one). By the way, the code comes from the book, "Swing Hacks" By … | |
Hi! I have a code that generates the table with 6 columns, and 6 textfields. Textfields are used to filter the table, and they are assigned to columns. Everything works normally, but looks badly. Attached you will find a picture to see what I mean. I don't like that textfields … | |
I have completed a program and it compiles fine. When I run it, it seems to run fine. The only thing is that I am missing element data for two of the objects I am printing out in the text area of this JFrame. I an array called printerProduct[5], that … | |
I found some code that does something that interests me, but I don't fully understand the implementation. The part I am struggling with is where the author "overrides" an "actionPerformed" method. I have a vague idea of why someone would want to override a method that is inherited from the … | |
Hello All, I am student just starting Java. I do need help with swing - GUI. I am creating 4 textfield that accepts input from 3 user and will display as a 2D Array in the text area. As well as calculate the average of one column from the input. … | |
Hello DaniWeb kings and queens - Here is a simple jquery .animate block here's the code: [CODE] <!DOCTYPE html> <html> <head> <title>TestingJ</title> <meta name="description" content="Mseed Web Design" /> <meta name="keywords" content="web design, programming, scripting" /> <meta name="author" content="Eric Karen" /> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="/css/global.css" /> <script … | |
hey... hi there .. i m currently using NetBeans for creating A simple desktop application in java,,,, so in the registration page.. i m getting some errors my code is import java.sql.*; import java.lang.*; /* * register1.java * * Created on September 7, 2010, 10:59 AM */ /** * * … ![]() | |
Hi! Please, explain me why JTextField: txtFirstName and JTextField: txtLastName are not visible on my JPanel: panfortab?! I can see only JTable: tableDetails. [CODE] private void createBaseRight() { JPanel panfortab = new JPanel(); panfortab.setBounds(330, 150, 650, 795); panfortab.setVisible(true); panfortab.setOpaque(true); panfortab.setBorder(bord); FilterClass fc = new FilterClass(); fc.setVisible(true); panfortab.add(fc); pan.add(panfortab, "Right"); // … | |
Hej guys! I have a little problem with layouting Swing components. I just need to add JTree: tree to the UPPER corner of JScrollPane: scrollpanesearch, and 4 buttons to the BOTTOM corner. What I have now is JTree: tree on the LEFT, and 4 buttons on the RIGHT (see Figure … | |
I am create one program that contain two combo boxes. If first combo box i am display all date. If i select one date from first combo box then the second combo box display some dates based on first combo box select date. Here is my full program [CODE] import … | |
Hy...My name in Alin , and I'm new using Java language/code . I'm trying make a little / simple JAva desktop aplication . Sometthing like phone book , but very very simple . I using Neatbeans 6.8 and mysql-essential-5.1 .I maked interface of that project using Java swing , I … | |
Hi guys! I have a problem with adding a row filter to the JTable component. Below is a code that I'm using: [CODE] public class FilterClass extends JPanel { TableRowSorter rowSorter; private DefaultTableModel tableModel; public FilterClass() { //super(new GridLayout(1,0)); initComponents(); rowSorter=new TableRowSorter(); tableModel = (DefaultTableModel) tableDetails.getModel(); rowSorter.setModel(tableModel); tableDetails.setRowSorter(rowSorter); } private … | |
Hello Daniweb, I have a program due this evening and am ready to give up. I can't figure out my compile problems: C:\Users\Chris\Desktop\My Java Programs\Chris_Y_Week_5_IA.java:85: call to super must be first statement in constructor super("mortgagecalcsr7"); ^ C:\Users\Chris\Desktop\My Java Programs\Chris_Y_Week_5_IA.java:573: inner classes cannot have static declarations public static void main(String[] args) … | |
Help me.....i'm tryin to figure out how to link to another java class using a button but i falied to do so...kindly assist me....thanks [CODE] public Login() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400,400); java.awt.Container contents = getContentPane(); contents.setLayout(null); setTitle("Air-Malaysia"); contents.setLayout(null ); contents.setBackground(Color.black); contents.setForeground(Color.orange); am.setFont(f1); usrnm.setFont(f2); clk.setFont(f2); clk.setBackground(Color.black); clk.setForeground(Color.orange); btnOk.setBackground(Color.black); btnOk.setForeground(Color.orange); btnCancel.setBackground(Color.black); btnCancel.setForeground(Color.orange); usrnm.setForeground(Color.orange); … | |
[CODE] package testt; import java.awt.*; import java.lang.*; import java.applet.*; import java.awt.event.*; import javax.swing.*; public class Login extends JFrame implements ActionListener { //JFrame logframe = new JFrame(); JLabel am=new JLabel("Air-Malaysia...."); JLabel usrnm=new JLabel("Username : "); JLabel nwm=new JLabel("Not yet a member? "); JButton clk=new JButton("Click Here"); JLabel pswrd=new JLabel("Password : "); … | |
here is my code [code]import javax.swing.*; import java.text.DecimalFormat; class method { private static void start() { JOptionPane.showMessageDialog(null," Area of a Circle"); String n = JOptionPane.showInputDialog(null,"Enter a Number"); int num = Integer.parseInt(n); DecimalFormat twoDigit= new DecimalFormat("0.00"); double form1 = 3.14 * (num*2); JOptionPane.showMessageDialog(null,"… is "+twoDigit.format(form1)); } public static void main(String[] args) … ![]() | |
Hi, My java is really bad and I haven't had to use it in a few years but I want to make it better so I've decided to try building it up slowly but at the moment I'm a little stuck and was wondering if anyone could help point me … | |
pls help............ hello frnds i ma mukul i am working on a java project in netbeans i am using swing application there is a use of JTabbedPane for which i have to give the object of other class as a Parameter but when i create another class outside the previous … | |
I am new in java swing. Currently i am create one application. I am using one button name is 'Add entry'. if i click the add entry button then display one frame that contain some textfields. i am enter datas and click save then the value save in database record … | |
I'm running into a roadblock on my program and the deadline is Tuesday(9/14). I'm at work all day and I'm hoping the interwebs can help me while I'm away (i can check @ lunch). I'm very new to Java and I'm still trying to digest the terminology so any clear … | |
Here is a starter program that prints prime factors of a supplied numbers as a string.It's quite buggy as the input 8 yields 1.2.4 when what i wanted is 1.2.2.2 and I don't understand why the return in line 32 (commented) is not executed. [code=java] //program to compute prime factors … | |
THIS IS A PROGRAM THAT WILL OPEN A WINDOW, THEN WHEN YOU CLICK CALCULATE GPA, A JOPTIONPANE THING WILL OPEN AND YOU WILL PUT YOUR GRADE IN, THAT WILL HAPPEN 2 MORE TIMES THEN THE LAST ONE WILL SHOW YOU YOUR GRADE AVERAGE. WHEN I COMPILE THIS PROGRAM, EVERYTHING IS … ![]() | |
import javax.swing.JOptionPane; class homework{ public static void main(string[]args) { String ipt,n,h,r,r2,h2,b1,b2; Double iptipt; JOptionPane.showMessageDialog(null,"1… of a Circle\n" + "2.Area of a Trapezoid\n" + "3.Volume of a Sphere\n" + "4.Volume of a Cylinder"); ipt = JOptionPane.showInputDialog(null,"Input your desired choice(1,2,3,4)"); iptipt = Double.parseDouble(ipt); if (iptipt == 1) ------ IF ELSE STATEMENTS WILL … | |
Recently I have made a simple chatting application(in Java). It has two classes one for client and one for server.On compiling it is not giving any error but on running, it is not giving desired result. So, It will be grateful if you come ahead and try out helping me … | |
Hello friends, I am working on my final yr project using Java Swing. Now for the database part can anybody tell me which I should use among Servlets, Oracle or JSP or anything others. I mean which is currently used in industry at large. Hope to get advice. Regards Supratim | |
Hello everybody, I am Pinak. I want to build an apllication regarding encryption. However, I am confused. [B][COLOR="Green"]Should I use Applet or Swing ????? [/COLOR][/B] Can you tell me what is the difference between the two??????:) | |
/*A personal phone directory contains room for list names and phone number for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list,display the corresponding phone number.If the name is not found in … | |
Hi all, I have a JTree (JXTreeTable actually, but anyway, it should be similar). I use setShowsRootHandles(true), but the handles are not displayed. Do you know what may cause the problem? My current look and feel settings support these kinds of things. Thanks in advance. | |
Hi, I have this program that part of it is hard coded. Instead of hard coding it, I need to do a file read instead. Meaning, the hard coded part must be changed to reading the info I need from a txt file. May I know how to do that? … | |
Hey I'm trying to get a splash screen going for my application but having a problem in finding the image once the splash screen is called it returns a null. I'm trying to use the java standard 6 way where the splash screen is displayed before the jvm is started … | |
Hi I wonder if someone could point me in the right direction, I have two class`s in my program one is a search thread the other is the swing gui. I want to send updates and info from the thread to my gui but have not got any idea on … | |
Hi, I wrote a simple program that should display the text (with specific fonts), one color background and drawing. I tried to run the program but it didn't work. Any suggestions? What is the method of Graphics that allow you to draw within the program? eg java.awt.Graphics but I don't … | |
hey there guys, just starting to learn java and i'm having a little trouble putting code to paper. don't really want to ask the teacher because hes a perv but lets not get into that. okay, i am supposed to make a GUI for electronic voting ballot paper thingy and … | |
I am having problems with the following code. Here is my assignment for this week, Write the program in Java (with a GUI) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage, the term of the mortgage, and the interest … | |
I was wondering if i could incorporate swing, into the code to create a GUI?: [CODE]public class ComputerMerchandise { public static void main(String[] args) { java.util.Hashtable<Integer, Product> htProducts = new java.util.Hashtable<Integer, Product>(); for(Product product:Products.GetAllAvailableProduct()) { htProducts.put(product.getProductId(),product); System.out.println(product.toString()); } Hashtable<Integer,Integer> orders = new Hashtable<Integer,Integer>(); java.util.Scanner scanner = new Scanner(System.in); while(true) { … | |
![]() | I need help on this two assignments: # 1- Write a client and server, Java Swing application using socket connections that allows the client to specify a filename to the server in a Textfield and the server send the contents of the file back to the client if it exists. … |
Hi everyone. I wonder why the following code doesn't draw anything. [code=java] package AssProgLang; import java.awt.*; import javax.swing.*; import java.util.*; public class AssOutput extends JPanel { public AssOutput(Queue translatedQueue) { this.translatedQueue = translatedQueue; outputFrame = new JFrame(); outputFrame.getContentPane().add(this); // outputPanel attributes outputFrame.setLocationRelativeTo(null); outputFrame.setPreferredSize(new Dimension(640, 480)); //this.setPreferredSize(new Dimension(640, 480)); outputFrame.pack(); outputFrame.setTitle("ASS™ … | |
We have 3 shifts running at our plant, day 0720 - 1520 swing 1520 - 1120 night 2320 - 0720 I have a table storing the bags packed on each shift, and now need to display the team (tech, packer_l, packer_r etc) with the greatest number of packed bags depending … | |
Hi - what im trying to do is to create a way of centering an image on a frame no matter what the size of the frame. I have two classes: one called "Picture_Frame.java"; the other "MyImage.java" In the latter I get the image and paint it then call on … | |
..HEY GUYZ...Hey guys...I was trying to link the Input applet with the code such that, when the user selects like the "Edit function" it refers back to the input function with the empty spaces to fill the new Student information //Marcus Student's Database program. Using Linked List. //The prog. shud … | |
Hi,Norm jon, I am posting a new thread for tagging the code accordingly. Hope this helps out. 1.My ball is not bouncing within the circle i drew.(Within circle 2).It just goes vaguely toward one direction and comes back.I want the ball to bounce randomly.Just like in the game ball and … | |
Hello, ok I have a problem with JFileChooser.When I save a file with a name that exists already, It replaces the older file and saves the new one but I want make it show a confirmation message to the user to ask if they want to replace the file or … | |
can any one help!! Expand Post (Toggle Plain Text) import java.awt.*; import java.awt.event.*; import java.awt.Color; import javax.swing.*; import java.awt.Frame; import java.awt.geom.*; class BallEntity/*THE BALL CLASS*/ { private int top=0,left=0,height=0,width=0; //getter methods public int getTop() { return top; } public int getLeft() { return left; } public int getHeight() { return … |
The End.