Results 1 to 20 of 21
Thread: Image not displaying
- 07-04-2011, 03:00 PM #1
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
- 07-04-2011, 03:46 PM #2
Can you make a small program that compiles and executes that demonstrates your problem? You have not provided enough information.
- 07-04-2011, 04:09 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
And this has no use at all:
[QUOTE=sandeep43;219752]kind regards,Java Code:catch(Exception e){ e.getMessage(); }
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-05-2011, 05:55 AM #4
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
Hi Norm and josAH
@Norm:this is my code, my 1st line is my VariableName, it is not displaying at allJava Code:IconLabel.setVisible(true); DateFormat formatter ; Date date ; String schemaaccess = SchemaAccess.getText(); String GetSchema=SchemaName.getText(); String ArchiveSchemaName= ArchiveSchema.getText(); Document document=new Document(); try { Schema.setEnabled(false); AddServerName.setEnabled(false); Class.forName("net.sourceforge.jtds.jdbc.Driver"); String url = "jdbc:jtds:sqlserver://"+SrcServer+"/"+SrcConnectionString; Properties props = new Properties(); props.setProperty("user",SrcUser); props.setProperty("password",SrcSourcePassword); props.setProperty("namedPipe","true"); Connection conn = DriverManager.getConnection(url,props); java.sql.Statement sta = conn.createStatement(); ResultSet rs = sta.executeQuery("SELECT A.NAME FROM "+SrcConnectionString+".sys.tables A WHERE" + " EXISTS (SELECT B.NAME FROM "+ArcConnectionString+".sys.tables B WHERE B.NAME=A.NAME)" + " UNION " + "SELECT A.NAME FROM "+SrcConnectionString+".sys.views A WHERE " + "EXISTS (SELECT B.NAME FROM "+ArcConnectionString+".sys.views B WHERE B.NAME=A.NAME)"); date = new Date(); formatter = new SimpleDateFormat("dd-MMM-yy HH-mm-ss"); String Final_Date = formatter.format(date); while ( rs.next() ) { RecName = rs.getString("NAME"); document.add(new Paragraph(RecName)); java.sql.Statement stmt =conn.createStatement(); boolean rs1 = stmt.execute("CREATE VIEW "+GetSchema+"."+RecName+ " AS (SELECT * FROM OPENQUERY ("+ArcServer+",'SELECT * FROM "+ArcConnectionString+"."+ArchiveSchemaName+"."+RecName+"')" +"UNION ALL " + "SELECT * FROM "+SrcConnectionString+"."+schemaaccess+"."+RecName +")"); //System.out.println("CREATE VIEW "+GetSchema+"."+RecName+ " AS (SELECT * FROM OPENQUERY ("+ArcServer+",'SELECT * FROM "+ArcConnectionString+"."+ArchiveSchemaName+"."+RecName+"')" // +"UNION ALL " //+ "SELECT * FROM "+SrcConnectionString+"."+schemaaccess+"."+RecName +")"); UnionView.setEnabled(false); } conn.close(); JOptionPane optionPane = new JOptionPane("Successful creation of Synonyms and Union views", JOptionPane.INFORMATION_MESSAGE); JDialog dialog = optionPane.createDialog("Seamless Access"); dialog.setVisible(true); } catch (Exception e) { JOptionPane optionPane = new JOptionPane("Synonyms and Union views are not created in new Schema", JOptionPane.ERROR_MESSAGE); JDialog dialog = optionPane.createDialog("Seamless Access"); //UnionViewsBar.setIndeterminate(false); }
, what ever way i call it, it wont display.
but the image will come up after the process is finished, which is off no use
@josH: thats true, i just wrote it
- 07-05-2011, 06:31 AM #5
- 07-05-2011, 06:33 AM #6
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
so how can i do it junky, an idea please
Regards
Sandeep
- 07-05-2011, 06:50 AM #7
Lesson: Concurrency in Swing (The Java™ Tutorials > Creating a GUI With JFC/Swing)
How come people are incapable of doing their own research?
- 07-05-2011, 01:23 PM #8
Your code segment does not compile and execute. It does not show us the problem.
Where is the IconLabel created, initialized and added to the GUI?
The database code is not part of creating a GUI.
- 07-05-2011, 01:46 PM #9
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
Hi Norm
it is not initialized, it is added to GUI i use Netbeans and ya creating database is not part of GUI.
Regards
Sandeep
- 07-05-2011, 01:50 PM #10
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
IconLabel is JLabel and i added an image via properties and i have written code in Post-init in properties to invisible i.e. IconLabel.setVisible("false");
later in action performed of a button i have made it visible as i have shown in above, but it is not displaying.
Regards
Sandeep
- 07-05-2011, 01:51 PM #11
Please write a small, complete program that executes and shows the problem.
The code you have posted is useless for figuring out why an image is not displaying for you.
- 07-05-2011, 01:58 PM #12
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
Hi Norm,
to post other code i called it in other method its working fine, oly in this code it is not working. i can post other code which is not a problem but there is no issue in other code, i have it in this method where i have written above code where it is not working
Regards
Sandeep
- 07-05-2011, 02:46 PM #13
How can anyone compile and test your code to see the problem?
Given this one statement: IconLabel.setVisible(true);
It won't even compile.
Good luck then.
- 07-05-2011, 04:40 PM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
What Norm is saying is write a really really small piece of code that attempts to do what you want (show an icon label on the push of a button).
If that results in the same problem then show us that small code.
If it doesn't cause a problem then try and figure out why the small code is different from the above large code.
Because otherwise I might be tempted to pick apart your database code, which isn't what you are looking for.
- 07-06-2011, 06:03 AM #15
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
hi toll and norm
@toll: your 100% correct, when i attempted to write a small code, i got that image no issues came up, oly when i had plugged it with that database code i am getting that prob.
@norm: suggest me a different technique how i can show that image, i am trying from past 4 days on same bug, please.
all my requirement is during the database operation i have to show user saying "Processing", so dont cancel the process or close the window. i have done it by calling an image as u know which is not displaying. u suggest me a technique how to accomplish it, i will design and write code myself.
regards
Sandeep
- 07-06-2011, 06:51 AM #16
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
i observed something norm, whenever there is some database operation like creation of views in sql, my IconLabel is not visible or not coming. when there is no database operation IconLabel is working perfectly.
Regards
Sandeep
- 07-06-2011, 07:24 AM #17
You have been given a link to the Swing concurrency tutorial. Whether you choose to follow the tips in that tutorial is up to you.
db
- 07-06-2011, 09:23 AM #18
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
- 07-07-2011, 06:22 AM #19
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
Hi db and tolls and Norm
i used EDT, now im getting different error
Java Code:class SwingWorkerCompletionWaiter { private JDialog dialog1; public SwingWorkerCompletionWaiter(JDialog dialog2) { this.dialog1 = dialog2; } public void propertyChange(PropertyChangeEvent event) { if ("state".equals(event.getPropertyName()) && SwingWorker.StateValue.DONE == event.getNewValue()) { IconLabel.setVisible(true); dialog1.setVisible(true); dialog1.dispose(); } } } JDialog dialog3 = new JDialog(); Icon icon = new ImageIcon("processing.gif"); JOptionPane.showMessageDialog(myAppFrame,aboutGreeting, "About MyApp", JOptionPane.INFORMATION_MESSAGE,icon); */ worker.execute(); UnionView.setEnabled(false); [COLOR="red"] dialog3.setVisible(true);[/COLOR]
Worker program is
now the icon is displayed properly but im getting an unnecessary dialog box visible, if i make it setvisible=false then my image is not displayingJava Code:SwingWorker worker = new SwingWorker<ImageIcon, Void>() { @Override public ImageIcon doInBackground() { final ImageIcon innerImgs = new ImageIcon("processing.gif"); IconLabel.setVisible(true); return innerImgs;
help me out now dialog statement is highlighted in red because of which im getting error
- 07-07-2011, 07:51 AM #20
Member
- Join Date
- May 2011
- Posts
- 97
- Rep Power
- 0
Similar Threads
-
Displaying an image
By BariMutation in forum New To JavaReplies: 6Last Post: 11-12-2010, 01:23 AM -
Displaying an image
By Samari413 in forum New To JavaReplies: 10Last Post: 11-06-2010, 08:56 PM -
Displaying an image
By SWEngineer in forum AWT / SwingReplies: 11Last Post: 01-28-2010, 05:48 AM -
displaying image into screen !
By burningflower12 in forum AWT / SwingReplies: 14Last Post: 11-16-2009, 02:02 AM -
Displaying image in same jsp
By SreenivasGurramkonda in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-08-2008, 06:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
.gif)
.gif)

Bookmarks