It's mostly the "largeness" that I'm having trouble with. It's like working on someone's machine who has the res set to 640x480, even though I'm at 1280x1024.
Perhaps I accidentally turned on senior citizen mode? ;)
It's mostly the "largeness" that I'm having trouble with. It's like working on someone's machine who has the res set to 640x480, even though I'm at 1280x1024.
Perhaps I accidentally turned on senior citizen mode? ;)
I'm finding it pretty hard to read as well:
Fonts too large in post listings and buttons.
Posts take too much real estate for no real reason.
Not a fan of the light lilac - I didn't sign in to discuss my innermost feelings and get all weepy.
I didn't see a reference implying create=true as part of the DB url. I'm not sure where
you are seeing this.
Listing here: http://publib.boulder.ibm.com/infocenter/cscv/v10r1/topic/com.ibm.cloudscape.doc/cdevdvlp51654.html
Maybe you can hook up with this guy and write your assignment together: http://www.daniweb.com/forums/thread281987.html
I'm sorry, you must have taken a wrong turn on the internets - you seem to think you've found the Lazy Student Homework Completion Service.
You are mistaken.
I just want to have a program for my project but I cant create a program with this problem.
Well, I guess you should fail the project then.
That's how these things are suppose to work. If you can't actually do the work, you shouldn't receive a passing grade on it and you'll put more effort into learning the material so that you can do it.
Any other questions?
Yes.
'this' refers to the current object - whatever that object is. It could be anything.
'content' refers to whatever you defined it as. Most likely it's a Container ref obtained from getContentPane() somewhere in your program.
paintComponent() can definitely be called often and you really shouldn't be creating any new components in that method. It should just handling painting the component to the screen. Perhaps you should pop up the other screen from whatever event ended play.
Edit: Just a note on the double call: it's most likely being called a second time because it has to re-render the screen after you pop up a frame on top of it.
:icon_tortellini
Hey, if you can't pasta the pasta, then pasta you should just pasta pasta.
If you don't make an effort soon, it will be an easy calculation
GPA = 0;
If you dont want to contribute to a answer thats fine - I dont expect any answers but dont under any curcumstances insinuate that I have not RESEARCHED JTables and am just trying to get someone else to do the work for me!!!!
Is it okay to insinuate that perhaps you didn't read this portion of what he linked quite thoroughly enough? Would the circumstance that it specifically addresses setting the column width warrant a pass on your admonition?
hey, soul sister by train.
That seems a popular song with sig spammers :)
You need to override the isCellEditable(int,int) method in your table model to return false
public boolean isCellEditable(int row, int column) {
return false;
}
For use with anything other than trivial canned examples that you feed it?
You can't.
Haven't you learned anything from your previous posts asking others to do your work for you?
Get to work and show some effort.
General 2D graphics: http://java.sun.com/docs/books/tutorial/2d/index.html
2D space invaders game: http://www.cokeandcode.com/spaceinvaderstutorial
More animation: http://lmgtfy.com/?q=java+animation
No, you've just dragged up a year-old question that has already beed resolved and posted some code with no explanation. Do you think that is helpful?
isCellEditable() gets called by the table when you double click a cell to see whether or not to the editor should be invoked. If you want to respond to a data change immediately, you'll need to use a TableModelListener most likely.
>Also, any suggestions about platform independent solutions?
Java + Open Office
Did you bother to read any of the suggestions posted above? Are you completely unable to think for yourself?
Closing this thread. It's long outlived its usefulness.
I would wear custom t-shirts too, if only I knew where to find some. :(
So you randomly decided to rename some of your own classes from code you wrote that was working just fine previously and you don't understand variable declaration well enough to use the new class names where needed? Seems a little odd to me, but hey, what do I know.
As I already said - getting it to a point it will compile is a good place to start. Then you can approach adding/removing from the array.
Getting it to a state that it would even compile would help. You have all of your type declarations mangled up.
Did you write any of this code to begin with? If I were to guess, you're in the process of trying to rename variables and modify someone else's code and you don't understand it.
To the InfoObject. It would give you a more definitive way than focus gained/lost to select/deselect the items.
If you did want to implement a selection listener for the InfoObjects, you could create one pretty easily with
interface InfoSelectionListener{
public void selectionChanged(InfoObject info);
}
Then your InfoObject would need to maintain a listener list
List<InfoSelectionListener> listeners = new ArrayList<InfoSelectionListener>();
and have a couple of methods to add listeners and fire events for them
public void addInfoSelectionListener(InfoSelectionListener listener){
listeners.add(listener);
}
private void fireSelectionChanged(){
for (InfoSelectionListener sl: listeners){
sl.selectionChanged(this);
}
}
and your viewer would just need to implement the InfoSelectionListener interface and add itself as a listener when you created the InfoObject items
ndbo.addInfoSelectionListener(this);
Whenever the selection state of the InfoObject changed, your InfoObject would use the fireSelectionChanged() method to notify the listeners, perhaps on mouseClicked()
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
setSelected(!selected);
if (selected) {
fireSelectionChanged();
}
}
});
The easiest thing to do would be just add a checkbox to the panel to set a boolean "selected" property on the object. That would allow multiple selection as well.
Here's an article on MVC if you care to read more on that topic: http://java.sun.com/developer/technicalArticles/javase/mvc/?intcmp=3273#3
You know, you could get by using just one exclamation point or question mark instead of 3-10 each time.
Typing in caps doesn't help your case either - it just irritates people.
Well, it's certainly not spam ;)
>This new look is stupid. ...
Yeah! Rabble, rabble, rabble!!11!
Sorry to hear that you are feeling sick. Perhaps you just need some fresh air. (This thread didn't though...)
No, not as a language feature. Many editors have tags for collapsing section of code though.
You could also take a look at this post that demonstrates the absolute basics of drawing a couple of lines on a JPanel. If you check the Graphics (and Graphics2D) API, you'll find other methods for drawing other shapes.
If you actually expect anyone around here to believe that, it is absolutely no wonder that you're having a tough time with pseudocode.
It's practically pseudocode as you have it posted. Show some effort, post what you have so far, and ask specific questions about the part you're having trouble with.
>How would I grab the information located on the jPanel that I want to display on the second monitor? (is there a quick easy way to duplicate the panel)
I've put together a small example of how you might do that below. Perhaps it will give you a starting point.
>Would I encounter issues with the fonts? (Seeing as the second monitor will be much larger than the original one)
Yes, if you're using an enlarged image you will have pixellation effects.
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class PanelCopyTest extends javax.swing.JFrame {
/** Mirror image panel - see class def below */
ImagePanel imgPanel;
public PanelCopyTest() {
initComponents();
}
/** blah blah, ui setup */
private void initComponents() {
panMain = new javax.swing.JPanel();
txt = new javax.swing.JTextField();
btnCopy = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
panMain.setLayout(new java.awt.BorderLayout());
txt.setText("Stuff");
panMain.add(txt, java.awt.BorderLayout.CENTER);
btnCopy.setText("Copy");
btnCopy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCopyActionPerformed(evt);
}
});
panMain.add(btnCopy, java.awt.BorderLayout.SOUTH);
getContentPane().add(panMain, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>
/** This is where the relevant stuff occurs */
private void btnCopyActionPerformed(java.awt.event.ActionEvent evt) {
if (imgPanel==null){
// first time set up the mirror panel
imgPanel = new ImagePanel();
JFrame f = new JFrame();
f.add(imgPanel);
f.setBounds(0,0,getWidth(), getHeight());
f.setVisible(true);
}
// create a buffered image to draw the source panel onto
BufferedImage imgCopy = new BufferedImage(panMain.getWidth(),
panMain.getHeight(), BufferedImage.TYPE_INT_RGB);
// paint the source panel onto the image
panMain.paintComponents(imgCopy.getGraphics());
// push it to the mirroring panel
imgPanel.setImage(imgCopy);
imgPanel.repaint();
}
/** Simple panel that displays an image */
class ImagePanel …
Yes, I was trying to steer him towards figuring that out for himself... :icon_rolleyes:
It depends somewhat on how your video card(s) are representing the screen devices to the system. You can get the bounds of a GraphicsConfiguration to determine where it is in your graphics space. If your monitors are returned as separate devices, you can figure out where the bounds of each are and where you need to put your components.
On my current system with three monitors, getScreenDevices() returns a single device with bounds that span the total area of all three - so to position something on the third one all I can really do is figure x0=2*width/3. Your system may be different and return each monitor as a separate device, each with it's own bounds.
It will likely take you a bit of experimentation and examination of what info your system is returning to nail down exactly how to isolate your target area.
Well, that's plenty of time - provided you have actually learned anything in your class so far.
Get to work or fail the project. It's all up to you. No one is going to just give you a copy of this.
i m doing project in controlling pc via mobile .so pls tell some ideas & give documents to my id ImSoLazy @ gmail.com pls..........
Why? It's your project. You're supposed to be learning something and showing some initiative with it - not hijacking someone else's thread to ask others to do your work for you.
Try searching around on your own and if you need some help post specific questions in the appropriate forums.
File > Project Properties > Libraries
Add the folder/jar/etc in the Compile tab.
Iron Maiden - "The Trooper"
And some additional reading: http://www.daniweb.com/forums/faq.php?faq=daniweb_policies#faq_keep_it_clean
The returned object will be a TypeEntry object. You have to cast to that and use its getValue() method.
TypeEntry selectedType = (TypeEntry)combo.getSelectedItem();
int typeValue = selectedType.getValue();
Perhaps you should read the forum rules:
We strive to be a community geared towards the professional. We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.
It just depends on how the users will work with the separate panels. With tabs, all will be layered on the screen and only one can be active at any one time, whereas with the internal frames you can show as many or as few of the collection as you wish and they can be arranged in any manner you choose to view simultaneously.
Try using an InternalFrameAdapter instead of FocusAdapter. JInternalFrames don't generate the same events as regular frames.
http://java.sun.com/docs/books/tutorial/uiswing/events/internalframelistener.html
Using the activate and deactivate events should work for you.