I'm currently writing a small program, where I need to save data into a Defaulttablemodel in a jTable.I have to save the name, a number and the email-adress.I added a button which opens a new JFrame and there I need to change the email and/or the name.My current solution is far from good: No matter which row I select, i can only update the "newest" row (last created). How can I visualize the values of the selected row (out.println// or whatever) so I can go further and overwrite these values.My Code when I click on Update:
int zeilenwahl = jTableStudenttab.getSelectedRow();
// System.out.println(jTableStudenttab.getSelectedRow());
if (zeilenwahl != -1) {
this.setVisible(false);
new Bearbeitung().setVisible(true);
} else {
JOptionPane.showMessageDialog(rootPane, "Zum Bearbeiten Zeile auswählen");
}
private int [] selectedAnimals; ... public int[] getSelectedAnimals() { return selectedAnimals; } public void setSelectedAnimals(int[] selectedAnimals) { this.selectedAnimals = selectedAnimals; }
I would like to know how to display the values of selected checkboxes on the JSF page after submitting the form? I tried outputtext, however it displays the object and not the values. I cannot even frame the outputformat for the same.
My question is, how do I get my Cube to visualize in the JPanel? I've tried a bunch of add methods but they don't compile. Is there a proper method I can use to add an object to a JPanel?
I am making an edit page and I want to populate my drop down menu with things that were already selected. For example, if i want i click to edit my favorite food it will be populated with the one the user previously selected. How do i go about doing this? [URL] ....
I was wanting to select an item in a comboBox and display it in a text field but all it's doing at the minute is retrieving the first item in the comboBox and placing that in the txt field
String value = (String) comboBoxEnv.getSelectedItem().toString(); if(comboBoxEnv.getSelectedItem()!= null){ txtTo.setText(value);
I just learned about 2D arrays and am still trying to get a grasp on the concepts. I'm a little confused by how you return all the values in a row to add up and display the sum if the row is entered by the user.
import java.util.*; public class RowSum { public static void main(String[] args) { Scanner s = new Scanner (System.in); int userpick = 0; int sum = 0;
I need to somehow compare the random color chosen from the color array and the random name selected from the name array. I know how to compare to entire arrays of the same type such as integers. How to go about this with two different arrays. I thought maybe I could parse the color array selection to a string but had no luck with that either.
Problem #1: Design and implement an Applet that plays a simple game to teach a child to read. The game displays a picture on the left hand side of the Applet and a word on the right hand side. Below the pictures are two buttons for the child to click--one if the word matches the picture, the second of the word doesn't match the picture. Display an error message if the child is incorrect (or play a sound). Display (or play a sound) display words of encouragement if the child chooses correctly. Add a loop so the child can keep playing.
How can I make the JTextField to popout when a JCheckBox is selected? I tried putting it under the general if statement and under the if statement which is inside the general if statement.
I want perform some calculations whenever a specific cell block is focused in JTable, I've tried using focusListener on JTable but looks like my table isn't triggering the event. I don't know why, what to do?
I'm working on a spreadsheet like app using JTable and was wondering if I can make the first cell of the table be selected when the window opens. Is there a way to do so?
I am having a problem with the SelectOneMenu control. I want the the selected item to be be displayed via the valueChange Ajax event listen. But this is not happening.
However, when I change the value in the SelectOneMenu and then click on the Submit button, then selected value is getting displayed via the 'save' bean function
The relevant xhtml code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <style type="text/css">
I used Primefaces 4.0.7.I has trouble with checkboxes, which are not change,with unselected checkboxes when I press . I mean, i selected someone from selectone menu in my bsPanel(first panel) and then the datatable fills with his/her duty.Then I select all the duties in the datatable to assign to someone else in bilgiPanel. Then duties assign this person and then i choose same person in the top panel(bsPanel),then datable seems with selected sutiesHere xhtml file;
I want to synchronize a List<String> with the selected items of a ListView. In the real project, I want to synchronize the selected items of a TreeView and the selected images of a galery (custom control).
In most cases, the program works as expected but sometimes there are some issues.
- For example, when I launch the application and select all the items with Ctrl-A, the event { [One, Two, Three] added at 0, } is fired so the list of strings contains incorrectly 4 elements [One, Two, Three, One].
- Another example, when selecting all the items (with Shift+End), two events are fired { [One] removed at 0, } and { [One, Two, Three] added at 0, }, that's correct. But when I remove the last element with Shift-Up, 3 events are fired { [Two] removed at 1, }, { [Three] removed at 2, } and { [Two] added at 1, } and an exception is thrown:
java.lang.IndexOutOfBoundsException: toIndex = 3 at java.util.ArrayList.subListRangeCheck(ArrayList.java:1004) at java.util.ArrayList.subList(ArrayList.java:996) at com.sun.javafx.binding.ContentBinding$ListContentBinding.onChanged(ContentBinding.java:111)
I'm trying to add filtering content in ListView by selected date from DatePicker. Every position(movie) has it's emission date saved, so when you choose date that you're interested in, it will show just matching titles. I was trying to use this solution:
I need a way to store the pixels values currently on the screen and compare them to the values on the first frame. Right now I'm using glreadpixels as follows:
currentBuffer= BufferTools.reserveByteData(mapSize); glReadPixels(mapStartX, mapStartY, mapWidth, mapHeight, GL_BLUE, GL_UNSIGNED_BYTE, currentBuffer); for (int i = 0; i < mapSize; i++) { if (currentBuffer.get(i) != baseBuffer.get(i)) { //Do nothing continue; } //Do something }
This works perfectly fine but turns out to be a real bottleneck, dropping the fps to a third of what it was. Is there any quicker way? All I'm after is speed, I don't even need to show it on the screen if the comparison is made "behind the scene".
I have a mySql table of PROJECTS, which I am displaying as a list in the index.xhtml. The projectid column contains hyperlinks. When they're clicked I would like the specific projectid row selected to be passed as the query argument into another jsf file (ListProjects.xhtml) which displays all the project values referring to the projectid selected in the index.xhtml. The named query is:
@NamedQuery(name = "Projects.findByProjectid", query = "SELECT p FROM Projects p WHERE p.projectid = :projectid") index.xhtml <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"
[Code] ....
I get the following stack trace. How to correctly pass the hyperlink parameters.
org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to invoke public void com.manaar.beans.SelProjectMgtBean.init() on com.manaar.beans.SelProjectMgtBean@681859ae at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:91)
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 = "";
I have to use the company's login resource, which returns a login page for authentication after a browser/user page request; after successfully authenticated, the session attributes are set in a (remote) valued object (VO) invoked via servlet; then, such values are set in my (local) POJO.
I want to display the current user session attribute (see xChave below) and save it in database. How can I persist http User session attributes through the structure below?
Abstract Controller (just the main code):
public abstract class AbstractController<T> { @Inject private AbstractFacade<T> ejbFacade; private Class<T> itemClass; private T selected; private Collection<T> items; //GETTERS AND SETTERS OMMITED public AbstractController(Class<T> itemClass) { this.itemClass = itemClass; }
I am doing project on glossary in java. Basically what i need to do is, i have a case study in the text field, when i mouse over the certain text that i already store in database. The text will be highlighted and automatically display the tool tip and content the data that i stored in my database.
I want to do an app that capture a selected area of a screen and save it. I did a few research and i did the code down below.
My questions are:
1 - How can i open a pdf file in this app ? (i tried use a method but it didnt work. I dont know exactly where to put it on the code)
2 - How can i save the selected area in a new file ? (a image file : JPEG, JPG,png)
3 - [the complex part] right now, the code only "save" one selected area each time. I want to capture a lot of parts of screen and save this in the same image file. one beside the other. How can i do this ?