Swing/AWT/SWT :: Error When Delete Rows With Multiselect

Feb 20, 2014

I have this error when i want delete rows in db... I have this error:

java.lang.String cannot be cast to QueryEliminaMultiSelect

In this class i have write:

class QueryEliminaMultiSelect {
int idNumDel;
String dataDelString;
String nomeDelString;
String emailDelString;
String telDelString;

[Code] .....

where is error???

View Replies


ADVERTISEMENT

Swing/AWT/SWT :: JTable Not Able To Render Rows In Different Colors

Aug 24, 2014

I have a jtable , a customtablemodel and a customcellrenderer with the NetBeans IDE. I want to have different colors for different rows. But anytime I run the application , the rows are not painted as expected. The code snippets are provided below.

This code is from the jtable :

duesTable = new javax.swing.JTable();
duesTable.setModel(duestableModel);
TableColumn tcol = duesTable.getColumnModel().getColumn(2);
tcol.setCellRenderer(new CustomTableCellRenderer2());
duesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);

this code is from the TableCellRenderer

public class CustomTableCellRenderer2 extends DefaultTableCellRenderer{
@Override
public Component getTableCellRendererComponent (JTable table,
Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
Component cell = super.getTableCellRendererComponent(
table, obj, isSelected, hasFocus, row, column);

[Code]...

This is from the Table Model.

public class DuesTableModel extends AbstractTableModel implements TableModelListener {
private List<List<Object>> dataList = new ArrayList<>();
private String[] header = { "ID"," PAYMENT YEAR" , "AMOUNT"}; // Payment year is a date
datatype
private int minRowCount = 5;

[Code]....

View Replies View Related

Swing/AWT/SWT :: Add / Edit And Delete JTable With Database

Apr 2, 2015

I currently have all the code working to fill my database and to display it, although I would like to have it displaying in a JPanel but I cannot figure it out so a JFrame will do. Add, Edit and Delete button for the JTable so I can add rows to the table and database, edit existing rows and delete rows also.

Here is the code for my current class.

package ManGUI;
import Database.DatabaseOperations;
import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.xml.crypto.Data;

[Code] .....

View Replies View Related

Swing/AWT/SWT :: Matching Strings To Selected Rows In JTable

Nov 10, 2014

I have a JTable which shows pdf files. In Addition I can check if they have errors, if it so I can generate a "report" by clicking the pdf. But the report gives me errors from all of the pdfs in the table. How can I match the error messages to the pdf which I select?

Here is one of the checking methods:

public static void testAllPagesHaveSameRotation(PDFDocument pdf) throws PDFDocumentException {
if (SettingsGui.testAllPagesHaveSameRotation.isSelected()) {
if (pdf.getPages() == 0) {
rotationError = "";
} else {
rotationError = "";

[Code] ....

View Replies View Related

Swing/AWT/SWT :: Refreshing GUI - Display Table With Several Columns And Rows

Jun 6, 2014

I have an application that displays a GUI and this GUI displays a table with several columns and rows. I have a class that extends DefaultTableModel. I wrote the code that displays the GUI. When the database table changes, how would I updated the GUI dynamically? Do you have any sample code that does that?

View Replies View Related

Swing/AWT/SWT :: Rows In JTextArea - Entering More Lines Than Limit

Jan 9, 2014

Here's a snippet of code from a program I'm making:

private void init() {
...
testInfo = new JTextArea("Progress log:
");
testInfo.setEditable(false);
testInfo.setLineWrap(true);
testInfo.setPreferredSize(new Dimension(testInfo.getPreferredSize().width, 200));
scrollPane = new JScrollPane(testInfo);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
...
add(scrollPane);
}

The problem is, the JTextArea that's created has a "limited" number of rows - it seems you can still enter more lines than the "limit", but they don't show. I thought it was a problem with the JScrollPane but I'm not so sure...

View Replies View Related

Swing/AWT/SWT :: Compile Error - Cannot Find Symbol With SetDefaultCloseOperation

Jul 21, 2014

This is likely a simple matter, but my error is confusing given the line it flags matches a working project I have. I get the following error on line 6 in the Controller:

cannot find symbol
v.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
...........................................^
(carrot at the J)

My view file:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class View extends JFrame{
private JLabel lbl;
private JButton btn;

[Code] ....

View Replies View Related

Swing/AWT/SWT :: Traffic Simulation - Applet Not Initialized Error

Mar 25, 2006

I have a traffic simulation code that is producing a start:applet not initialized error each time i run it. This is the code

import java.io.InputStream;
import java.net.URL;
import java.util.*;
import java.awt.*;
import java.applet.Applet;
import java.lang.Thread;
class Node {

[Code] ....

View Replies View Related

Java Swing- After Pressing JButton It Is Not Giving Error Nor Output

May 15, 2014

Problem: On the form window, after pressing the button, it doesn't give any error and doesn't give any output. It doesn't reply and i have to stop compiling to exit. Why does the IDE do that, is it about my Java codes or Form Window codes ? ( I have two classes named Lexical.java and window.java. Working with Eclipse)

Details: I am working on a project that makes Lexical and Syntax analiysis of commands written in SQL Language. My form is in the attachment. If will be necessary i'll put my codes too.

Attached image(s)

View Replies View Related

How To Delete A Thread

Nov 19, 2014

Doesn't matter now, I solved it but I don't know how to delete a thread...

View Replies View Related

Delete From ArrayList

Dec 7, 2014

I've this "program" that shall manage to register a dog, show a list of all registerd dogs and delete dogs from the list.. And I'm stuck at the latter one. So I've to classes, one for the dog and one for register/program. This is my main program

package hundRegister;
import java.util.Scanner;
import java.util.ArrayList;
public class HundProgram {
private static Scanner tangentbord = new Scanner (System.in);
private static ArrayList<Hund> hundlista = new ArrayList<>();

[Code] ......

So, when I enter a name on a dog that exist on my list, it just jumps down to } else { and write that dog can't be found even if I write the exact name on the dog.

I can't see what I'm doing wrong, been trying out different methods now.

View Replies View Related

JSF :: Move Datatable Rows Up And Down?

May 22, 2014

I have a requirement like in a Rich datatable, and i have placed two links up and down in one of the column of each row, here i wanted to swap rows (move up/ down ) the rows when i click the link on a perticular row. is it possible with jsf/ java script?

View Replies View Related

Insert Multiple Rows

Mar 12, 2014

how to insert multiple rows in a database..i want to insert multiple rows but this can happen when i hit the submit button once. i use j2ee and db is postgresql.

View Replies View Related

Fetching Rows From 2 Tables Using HQL

Sep 29, 2014

Using HQL I am fetching the rows , now i need to iterate through the list and convert each row in the list to a "string" and append the string to a buffer.... How to do it

View Replies View Related

Justify A Column Of Several Rows Of Name

Jan 5, 2014

How can i left justify a column of several rows of names, then right justify them?

View Replies View Related

Swing/AWT/SWT :: Error At Class Name - Type JTextField Must Implement Inherited Abstract Method

Oct 27, 2014

This code is directly from Swing: I'm using Eclipse and keep getting an error on line 10 saying :

"The type JTextField must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)."

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

[Code] ......

View Replies View Related

How To Delete Files From Ftp Location

Jan 28, 2014

how to delete the files from ftp location

View Replies View Related

Delete From Queue Not Working

May 29, 2014

leaveQ method does not work..To see the other files related to these code click here:(Its a dropbox location) URL....Java Code:

public class CustomerQ {
private int MaxLength;
private int totalCustomers;//assuming #of customers served
int Qlength;
Customer cus;
LinkedList4Q cus4Q;

[code]....

View Replies View Related

How To Perform Soft Delete

Feb 25, 2014

how to do soft delete?

View Replies View Related

Modify And Delete Functions

Apr 4, 2014

I am writing a program for my Java class and I have every function of the program working aside from the modify and delete button. I'm not sure how to make them work. The course material doesn't cover these functions at all.

Here is what I have so far.. which is practically nothing. If I need to post any other code I will, I just don't want to post more than needed because going through unnecessary code can waste time.

public void actionPerformed(ActionEvent e)
{
inventoryTotalField.setText(String.valueOf(genre[ArrayIndex].getInventoryTotal()));
//add button functions
if (e.getActionCommand() == "First")//if first button is clicked
{
ArrayIndex = 0;//set array index to the first element in the array
setFieldValues(); // display dvd info on the form

[Code] .....

View Replies View Related

Adding Rows And Columns In A Matrix?

Apr 16, 2015

I have a 5x5 array of which I read from an external file and I am supposed to print out the original matrix and then add up each row and column, proceeding to store them into the sixth positions in my matrix. After that I print out the new matrix.

For example this just using a 2 by 2,

Original
1 2 3 4 5
1 2 3 4 5
New 3 by 3
1 2 3 4 5 15
1 2 3 4 5 15
2 4 6 8 10 30

I am confused as to how to isolate rows and print them out. I know how to add the entire matrix up but isolation is my issue.

Here is what I have including how to read the matrix and the sum of the whole thing

import java.io.*;
import java.util.*; 
public class prog470cAddingRandC {
public static void main (String [] args) {
//read the file
Scanner inFile=null;

[code].....

View Replies View Related

Find Number Of Rows In CSV File

Feb 13, 2014

I am working through a text and I am supposed to complete the following tasks.

Your ReadFiles.java class requires the following methods:

Method: check to see if the file exists

Method: find number of rows in csv file

Method: Converts the csv file to a mutli-dimensional array

Method: PrintArray

Method: Return array using a get method

Create a file DataAnalyzer.java. This file will be used to call the methods in ReadFiles.java. Be sure to demonstrate that all of your methods work through DataAnalyzer.java.

The problem is that it does not really provide any information on how to go about reading a file into an array. I am stuck at the third task of converting the file to an array and I have tried several ways to do this unsuccessfully. I thought that I would at least try to get things to print out (line 87) to see if I could get that to work, but all that prints in null over and over again.

Java Code:

public class DataAnalyzer {
public static void main (String[] args) {
ReadFiles aReadFiles = new ReadFiles();
aReadFiles.fileCheck();
aReadFiles.findRows();
aReadFiles.convertFile();

[Code] .....

View Replies View Related

Multiple Rows Into Database From JTable

Apr 12, 2014

How to insert multiple rows into a database from a jtable and also retrive the same details from database and show it in a jtable.

View Replies View Related

Nested FOR Loops For Rows And Columns

Apr 21, 2014

I need to write a class,that will give me output like this:

*
***
****
***
*

I have to use for loop,i know that i have to use nested for loops, for rows and columns. I just cant figure it out the thing with spaces,and how to turn it to count back.

View Replies View Related

How To Get Arrays Which Are Rows In Game To Printout

Jan 18, 2015

For our final project we're making a game. I'm "trying" to do battleship in 2D, but its not going well. at all. I've started it but how to get the arrays which are my rows in the game to printout, and i need to put them into a seperate method and all them.

Scanner input = new Scanner(System.in);
String userN;
String B1;
String H1;
H1 = "onethree";

[code]....

View Replies View Related

JDBC :: BatchUpdate Rows Affected Is Always -2

Mar 27, 2015

I have a batch process which does Bulk UPDATE statement.

After implementing batch support using Spring JDBC 4.1.6 and Oracle Jdbc Driver (ojdbc7 and ucp), the number of records affected for individual update requests (in the batch) are always retrieved as -2 (Statement.SUCCESS_NO_INFO).

Is there any way to know the rows affected for individual cases, as I have to retry the same argument with an INSERT statement after this. Technically trying to develop this as an UPSERT implementation

I tried this batch update in Three Different Ways, and in all three methods the results are same -- (It just tells me Statement.SUCCESS_NO_INFO (-2) )

Method 1  -- Direct UCP Connection and PreparedStatement
        connectionPoolMgr.startConnectionPool("mgr_pool");
        Connection connection = pds.getConnection();
       
        PreparedStatement pstmt = connection.prepareStatement(dmlSQL);
        pstmt.setInt(1, pkId);
        pstmt.setInt(2, idx * 10);
        pstmt.addBatch();
 
[Code] .....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved