32,199 Topics
| |
Hie everyone, I am trying to develop a GUI through hard coding. I encountered a challenge: I created a Jframe and onto this I added a JPanel. **I assigned thge flow layout manager of the frame to null**(because i want to do the positioning of my components manually) The program … | |
hi,I want to learn java programming with start to end,Do you know any free website or books for me.plz answer i am nobb student. Thanks,uxama | |
Hello. I'm working on a project that requires some data to be encrypted with AES 128. My encryption works fine but when I decrypt I get an `Exception in thread "main" javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes` exception. Code: import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; public class AESCipher { private … | |
Hello everyone, I want to develop a GUI like the one shown in the image below. I want to do this through hard coding - no drag and drop. Please may you assist me with: 1. what should i include to come up with such a **layout**. 2. how do … | |
Write a function IsoTriangle() that takes a sizw parameter and displays an isosceles triangle with that many lines. Use the DrawBar() function as a Basis. it should look like this: * *** ***** ******* this is the drawbar() function: /*Overloaded DrawBar() program Illustrated overloaded DrawBar functions*/ #include <iostream> using namespace … | |
please assist by explaining what this code is trying to do - i mean the logic. if ((InteractiveForm.this.tableModel.getRowCount() - 1) == row &&//i dont understand this line(the logic) !InteractiveForm.this.tableModel.hasEmptyRow()) { InteractiveForm.this.tableModel.addEmptyRow();//this is where we append a new row } the whole program can be found [here](http://www.javalobby.org/articles/jtable/?source=archives) any explanation is greatly … | |
Hello everyone, I have my code that is supposed to append an empty row to a table at runtime when a user presses the enter button. The code is working fine. here is the code if it helps: table.addKeyListener(new KeyListener() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == … | |
Hi, I have been trying to create a game loop that is paused when a certain key is pressed. This seemed to work ok in Swing but in javafx the loop locks up the UI, even if i create a seperate thread. @FXML public void setPaused(KeyEvent e) { if (e.getCode().compareTo(KeyCode.P) … | |
I have seen these two methods of using ItemListener. I am curios which is better and why. What are the differences? ItemListener a; Choice ce = new Choice(); ce.addItemListener(a); ItemListener itemlistener = new ItemListener(); itemlistener.handle = checkboxmenuitem; checkboxmenuitem.addItemListener(itemlistener); | |
JMenuItem mItem[] ={copy,paste}; for(int b=0;b<mItem.length;b++) { mItem[b].addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { String mItemCommand = e.getActionCommand(); JTextArea copypaste = new JTextArea(scr.getText()); if(mItemCommand=="Copy"){ copypaste.select(0,scr.getText().length()); copypaste.copy(); } if(mItemCommand=="Paste"){ copypaste.setText(""); copypaste.paste(); String num =copypaste.getText(); try{double n=Double.parseDouble(num); if(num.indexOf(".")!=-1) isDecimal = false; isFirstDigit = false; if( n-((long)n)>0.0) // I just didn't understand codes starting … | |
Hi friends, Here is my code for selecting datas from myql database with the help of php.All i want to do is i want to pass and display image through intent from Activity 1 to Activity 2.im new in android so please help me. **Activity1** import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import … | |
Hi there, Has anyone know to use voice commands on Android phones? I am developing a clock that is capable of displaying numbers and words. I would like to extend my project and to add GSM module so it is capable of receiving msg. I would like to use Android … | |
I am developing a Java application that uses a JTable. I want to allow the user to enter data in a JTable that can later be printed or saved as PDF file. The issues is: Suppose the user has entered some data and the cursor is on the last cell … | |
hello everyone, i am developing a quotation generator application using Java. I am using a JTable to capture user input(this input is taken from a database i.e. each cell of the tale will have a combobox where the user can select an input value). when the user is done he/she … | |
I'm writing some custom encryption code in Java for my server. The only problem is that in my encryption I'm using XOR. The data gets encrypted fine, but when I decrypt it doesn't decrypt correctly. I am not sure what is cuasing this problem. Here is my code that I … | |
hi, I am creating an android app that is supposed to retrieve data from a remote database (Mysql) I'd like to pass the parameter to my php file using url and get the result that I'll display in the apps can someone have an idea of how to proceed? thank … | |
hi i have changed a java process as the windows service. but in this whenever i am starting the windows service two java processes are running.it is spoiling my work totally can we have any way to remove a java process? | |
it is told that in object oriented language every thing is an object.. ihave written two lines:- int a; Object b; when i do b. options appears but when i do a. options do not appear..accourding to theory a is also an object then why the same option appear for … | |
hello sir... i'm abhishek .Can you help me to solve out some issues on smslib . i cant read message on smslib. please help Thanks | |
Can someobody tell me why i only see blank window. import java.awt.*; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; public class dic extends JFrame{ public JLabel label1,label2,label3,label4,label5,titlel; public JTextField ew,fw; public JTextArea txar1,txar2; public JPanel … | |
am trying to implement the State Space of the game towers of hanoi the problem i cannot implement a deep copy to an object the results are very wrong :) and am in a hell miss , all am trying to do is to insert the potential changes between bigs … | |
For a project, i have to create an address book and I am trying to get it to store the person data into an array list and read from a file text but have not been able to figure out how to do it. Here's the instructions: 1) Add a … | |
Hello everyone, I have a page written in HTML5 which atuomatically resizes the page when used on different devices. I also have a menu which goes from a drop down menu in desktop mode to a sort of pull down menu in mobile mode. This video pop-up works in desktop … | |
Hello i have an problem with an inheritance query using JPA (There is my Class Hierarchy) +UsuarioGenerico (MappedSuperclass or Entity - but is Abstract) -+Usuario (Entity) -+UsuarioPorEmpresa (Entity) Then, when i try make an select for Usuario, i not obtain results i try with an NamedQuery: `@NamedQuery(name="Usuario.findAll", query="SELECT u FROM … | |
Why this doesn't work? class Faculty extends Employee { private long[] officeHours; private String rank; public Faculty(long[] hours, String rank) { this.officeHours = hours; this.rank = rank; } public static void main(String[] args){ //some code here Faculty f = new Faculty(newToken[], tokens[tokens.length-1]); | |
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.swing.ImageIcon; import javax.swing.JOptionPane; public class Main { public static void main (String[] args) throws Exception { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/convocation","root",""); //ImageIcon icon = new ImageIcon("C:\\Users\\a\\workspace\\MysqlName\\img\\U.png"); //JOptionPane.showMessageDialog(null, "Custom", "Custom Image", JOptionPane.INFORMATION_MESSAGE, icon ); int id_convo= Integer.parseInt(JOptionPane.showInputDialog(null,"Please Insert Student Convo ID\n(eg:01,02,03)", "U … | |
1. N-queen problem The n queens puzzle is the problem of placing n chess queens on an n×n chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. Solutions exist for all natural numbers n with … | |
Hi guys. I'm working on a christmas present for my dad, it's a program that installs 8 Black Keys songs on his computer. I'm having some trouble with it though. I can't figure out how to get the files out of the jar file. I used to access them with … | |
| I am making my own component similar to the JOptionPane, but with some added GUI components specialised for my current project. I have finished with the GUI of the component, but I do not know how to make wait for the user to enter input before continuing, as the JOptionPane … |
The End.