How to make textfield appear inside a jtable ????

hi,
is there any way that i can make mi textfield show up inside a jtable which i have created ??

you may have to describe exactly what you are trying to do
in this thread, you want a textfield for additional values entered
http://forum.java.sun.com/thread.jspa?threadID=737376&messageID=4234595#4234595
in this thread, you want the cells uneditable
http://forum.java.sun.com/thread.jspa?threadID=740286&messageID=4246562#4246562
and, by the look of the posted code, you want a textfield separate from the table
here's a simple uneditable table.
if I click on 'fred', what do you want to happen?
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
class Testing extends JFrame
  public Testing()
    setLocation(400,100);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    String colNames[] = {"Name", "Age"};
    Object[][] data = {{"joe","21"},{"fred","31"},{"mary","22"}};
    DefaultTableModel dtm = new DefaultTableModel(data,colNames);
    JTable table = new JTable(dtm){
      public boolean isCellEditable(int row,int column){
        return false;}};
    JScrollPane sp = new JScrollPane(table);
    sp.setPreferredSize(new Dimension(300,100));
    getContentPane().add(sp);
    pack();
  public static void main (String[] args){new Testing().setVisible(true);}
}

Similar Messages

  • Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    "Organize Bookmarks" has been renamed to "Show All Bookmarks" in the bookmarks menu.

  • How to make arrows appear???

    Hey, I was wondering how to make arrows appear so I can point out what people did wrong in their softball swing and arm. Can you help me? Thanks.
    -Channing

    Hi Channing,
    searching the "usual suspects" I found:
    Stupendous - has some "highlighten" effects...
    and
    Geethreeoffers some "painting" (e.g. arrows) onto the video...
    I'm sure, searching at www.virtix.com and www.imovieplugins.com, you'll find more.....
    I don't profit from any recommendation or link, I'm a user, not a salesman.

  • Unable to see Inspection lot stock tab in UD??? how to make it appear?

    Hello Friends
    Some how i am getting three unexpected observation
    1. Inspection lot stock tab in UD is not there.....how to make it appear so that i can do the quantity posting can be done.
    For your information this is against good receipt & QA32 quantity to be posted is showing the qty correctly.....which means stk is in quality
    2. In MMBE transaction i am not able to view batch & qty posting
    3  In MB51 i can see the document details but qty is showing in unrestricted....which means stk in unrestricted which contractdory to my first statement.
    Kindly let me know
    1. How to make Inspection lot stock table available in UD
    2 Any clue for 2 & 3 point if possible.
    Thanks & Regards
    Swanand

    Thanks for reply
    But the problem is not of stock going to quality or not.....anyway i checked it and it's correct.
    Problem is i am not getting Inspection lot stock tab in UD.......here this inspection lot is created due to good receipt (inspeciton type 01)
    My query is not yet answered
    Thanks & Regards
    Swanand

  • I cant find sharing folder under Internet & Wireless,How to make it appear(?)

    I cant find sharing folder under Internet & Wireless,How to make it appear(?)

    Does it still exist here?
    /System/Library/PreferencePanes/SharingPref.prefPane
    You can copy & paste this in Finder > Go > Go To Folder... (Command+Shift+G)

  • Hi! Since I installed Mavericks, all the messages in mail I receive are marked as read, when they're not! Can anyone explain to me how to make them appear as not read, so I notice them? Thank's

    Hi! Since I installed Mavericks, all the messages in mail I receive are marked as read, when they're not! Can anyone explain to me how to make them appear as not read, so I notice them? Thank's

    I don't know if it will work, but try rebuilding the mailbox. This can take awhile if you have a lot of mail.
    Rebuild mailbox

  • How to Make Hair Appear in Front of and Behind an MC Object?

    Hello again,
      I am making a character with lots of hair. I would like to know how to make the hair appear both in front of and behind the Movie Clip object.
      I'll explain further. I have the "frontHair" connected to the "head" MC. When I pivot the head, a bare spot shows in an outlined shape of the arms/legs/torso. I thought I'd remedy this by making "hairBack" and then layer it behind the object. This opens up a can of troubles.
      I can't seem to get the "hairBack" to appear behind the torso and arms. Also, the "frontHair" is now blocking me from grabbing onto the arms and legs.
      It's crucial that this character has all of the hair, but I can't seem to figure out how to make it happen.
      Please, help!
    Thank you,
       Mike
    p.s. While returning from a beer run, I thought about masking. I'm still trying to work out the logic on this one.

    Thank you for replying. II didn't know which specific layers and objects you were referring to, but I figured out the problem I was having.
      I used only one newly created "hair" object and set it to "Guide" to get it out of the way (in a sense). I then selected all the body parts (movie clips) that I could and selected "Move to Front" for each one. I used the Selection Tool to move the head (with connected hair) out of the way. After doing this I was able to select the "torso"; which was previously hidden behind the Armature Layer. I then put the head back in place and I was set to roll.
      Ah, but then I encountered another error. My animations are set to 24fps, but they are moving at least 10 times slower. This happens within Flash and in the exported swf files.
    The topic deals with "text field variable names" errors and compiler errors dealing with "Symbol 'fps' ".
    This is the address to that topic. http://forums.adobe.com/thread/1009225
    Thank you (again),
      Mike

  • How to make tornado appear at a distance in a video.

    I made an energy torndo effect with CC particle world, its on a black solid with the blend mode on screen (two weeks in learning this stuff haha). How can I add it to the video and make it appear as if its right in front of me on the far distance?

    I might also consider using a different method to create the tornado.  If you're looking for realism I'm not sure CC Particle World will do it for you.  Personally I would create this effect practically by building a tornado box, like the ones kids make for elementary school science fares.  Then I would light your tornado in a black room, and film it.  Then take it into After Effects, mask it out, flip it vertically, set the blend mode to screen and composite it using the same suggestions Rick has offered.  There are plenty of links that will show you how to create a tornado box using dry ice.  Here's the first one I found:
    Also this is a very useful tutorial for doing horizon replacement using Mocha AE:

  • How to make a cell in a JTable to be uneditable and handle events

    I tried many things but failed,How do you make a cell in a JTable to be uneditable and also be able to handle events>Anyone who knows this please help.Thanx

    Hello Klaas2001
    You can add KeyListener ,MouseListener
    Suppose you have set the value of cell using setValueAt()
    table.addKeyListener(this);
    public void keyTyped(KeyEvent src)
    String val="";
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    val=table.getValueAt(r,c).toString();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor(r, c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt(val,r,c);
    public void keyReleased(KeyEvent src)
    public void keyPressed(KeyEvent src)
    table.addMouseListener(this);
    public void mouseClicked(MouseEvent e)
    public void mouseEntered(MouseEvent e)
    public void mouseExited(MouseEvent e)
    public void mousePressed(MouseEvent e)
    public void mouseReleased(MouseEvent e)
    if(e.getClickCount()>=2)//Double Click
    table.clearSelection();
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor (
    r,c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt("",r,c);
    }//Mouse Released
    You can remove keyListener and Mouse Listener whenever You want to edit
    then add it later.
    Regarding handling events implement javax.swing.event.TableModelListener
    table.getModel().addTableModelListener(this);
    public void tableChanged(javax.swing.event.TableModelEvent source)
    TableModel tabMod = (TableModel)source.getSource();
         switch (source.getType())
    case TableModelEvent.UPDATE:
         break;
         }//Table Changed Method
    //This method gets fired after table cell value is changed.

  • How to make drives appear on desktop on os lion

    How to make drives (and flash drives) appear on desktop on os lion?

    Finder > preferences > General
    select the items to show on the Desktop

  • How to make bookmarks appear in all user accounts w/out importing and exporting everytime.

    Hello, all. I'm imaging a couple of laptops to be sent out. I want the bookmarks on the admin user account to be applied to the network domain user accounts or roaming profile is you will. Is there a way to this without have to import/export?

    I am trying to do the same thing. I also cant get it to work. I am
    thinking it may have something to do with the concept of ScopedResponse, but
    I am not sure. There is very little documentation and more importantly
    examples of how to make sense of the getOuterResponse() method. Dev2Dev and
    Google are of no help.
    Anyone care to explain this to us?
    Michael.
    "Zhenhao Qi" <[email protected]> wrote in message
    news:3fd4f634$[email protected]..
    >
    Hi All,
    I have a jsp page to display a table. I want to add a "excel download"button
    in this page, once user click this button, it will invoke the microsoftexcel
    and all table content will appear in the excel spreadsheet.
    I tried to set the content: <%@ pagecontentType="application/vnd.ms-excel"%>
    the rest code as following. However, it won't work for me. Does anyone hasany
    experience in doing this?
    <%@ page contentType="application/vnd.ms-excel"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    </head>
    <body>
    <table border="1">
    <tr style="background-color:#3366ff;font-family:arial;">
    <td>Structure</td>
    <td>Compound</td>
    <% // Get the Items from the request stream
    Vector mr_names = (Vector) request.getAttribute("method_result_names");
    for (int f=0;f<mr_names.size();f++) {
    out.println("<td>" + mr_names.get(f) + "</td> ");
    Vector mrs = (Vector)request.getAttribute("method_results");
    for (int g=0; g<mrs.size(); g++)
    out.println("</tr><tr>");
    Vector row1 = (Vector)mrs.get(g);
    for (int f=0;f<mr_names.size()+1;f++) {
    String s = (String)row1.get(f);
    if (f==0) {
    %>
    <td><embed src="structure.jsp?Sample_code=<%=s%>"width="120" height="100"></embed></td>
    >
    <%
    out.println("<td>" + s + "</td> ");
    out.println("</tr>");
    %>
    </table>
    </body>
    </netui:html>
    Thanks!
    Zhenhao

  • How to make a graph inside a while loop maintain previous values

    In the beginning I was trying to use an the XY Graph Express VI to create a plot of points.  However, the graph is making a linear retrace between the first point of the new line, and the last point of the previous line.  It then creates the new line as desired.
    I have tried using a for loop with to bundle a cluster to the graph, but the graph resets the plot on each iteration (as expected) and I cannot find a way to make it maintain the previous data.  I tried using shift registers but was unable to find out how to do this, and I have also tried bundling the cluster to an array, but cannot figure out how to make the cluster go to a 1D array of a cluster of 2 elements.
    One option is having is finding a way to make it maintain previous data, but the preferred option is to make it create a new plot on each iteration so as to see the color change for each new plot.
    Solved!
    Go to Solution.
    Attachments:
    shift register attempt.JPG ‏64 KB
    original attempt.JPG ‏42 KB
    Output only current iteration data.JPG ‏86 KB

    I'm taking a stab at this because I'm not exactly sure what you want. But I think it is what I have shown here. You need to use a shift register on your outter while loop as I have shown. Your image where you tried using a shift register shows a misunderstanding of shift registers and how they work though, so I would take a look at these tutorials.
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    plot with SR.png ‏29 KB

  • How to make textfield to take only numbers, & it wont allow us to enter any other characters

    make textfield to take only numbers, & it wont allow us to enter any other characters

    Clean up the code a little (credit goes to Sakthivel
    var oInput = new sap.ui.commons.TextField();
    oInput.onAfterRendering = function() {
      if (sap.ui.commons.TextField.prototype.onAfterRendering) {
        sap.ui.commons.TextField.prototype.onAfterRendering.apply(this, arguments);
      this.$().keydown(function(event) {
        var ctrlKey = event.ctrlKey;
        var altKey = event.altKey;
        var shiftKey = event.shiftKey;
        var key = event.keyCode;
        return (
          ctrlKey ||
          altKey  ||
          ( 47 < key && key < 58 && shiftKey === false) ||
          ( 95 < key && key < 106 ) ||
          ( key === 8) || (key === 9) ||  
          ( key > 34 && key < 40) ||
          ( key === 46)
    oInput.placeAt('content');
    -D

  • How to make text appear underneath an image on rollover

    Hi guys,
    I woul really like to creat an effect like this site:
    Showcase21
    If you click on past and hover over an image, you get to see text underneath as well as the image in color.
    Any thoughts on how I can make that in Muse?
    Kind regards,
    Lester

    This can be done with the Composition Widget Tooltip Preset. The images would be created with the triggers, the text that appears would be the Target content for each.

  • How to make dock appear in all monitors, and keep new windows to same monit

    I've got an unusual setup: two screens at my desk, and another one in front of a recliner nearby so that it is not physically adjacent to the other two. This means that when the cursor moves off the side of two of the monitors and goes to the third one, I can't see it. I don't want to mirror all the displays because half the time I use the two adjacent ones from the desk, and sometimes I just want to use the one separate one. Can someone tell me if it's possible to
    1) make the same dock appear in all monitors? I want access to the dock no matter which monitor I'm looking at. Is there a utility or hack that will give me a dock in each screen?
    2) any way to have apps open and create new windows in whatever monitor I'm currently working? it's very annoying that sometimes I run a app and it throws up a window in the monitor I'm not looking at. Any way to keep it to the set of two or to the 3rd one, depending on which I'm using at the time?
    thank you!
    Mike

    Hi Mike, Might have a look at the bottom of this page for Dock-It 2.6.1 for Mac OS X 10.5.x and earlier...
    http://www.macupdate.com/info.php/id/8288/dock-it
    As far as the other problems, I'd try Mirroring #1 & #3.
    Move Off-Screen Windows to the Main Screen...
    http://zach.in.tu-clausthal.de/software/
    http://www.macosxhints.com/article.php?story=2007102012424539
    http://www.jonathanlaliberte.com/2007/10/19/move-all-windows-to-your-main-screen /

Maybe you are looking for