• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hide opened file using java

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Am new to this site..
I need to hide lastly opened file using java..
thanks
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

monicka rk akilan wrote:I need to hide lastly opened file using java.


Welcome to JavaRanch, Monicka.

A few things for you:
1. EaseUp (←click) - We're all volunteers here, and urgency is your problem, not ours.
2. TellTheDetails (←click) - Right now, I have no idea what you mean by 'hide lastly opened file'.

My suggestion: explain, in English, and in detail, what you're trying to do, and where this 'hiding' business comes in.

A few pages that might help you to ask your question a bit better:
HowToAskQuestionsOnJavaRanch
How to provide an SSCCE
How to ask questions the smart way

Winston
 
monicka rk akilan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi winston

i need to print a text file using Desktop class.
when i use that that file is first opening and then print..
but i no need to make that file visible to user.
how to hide that file..
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking how to make the operating system not see a file if it has been opened in Java?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Monicka, welcome to the Ranch.

Remember that we don't know anything at all about your program. That means you have to explain in detail what your program does, what it looks like, and what exactly you want to change. For example, we have no idea where and how the "opened file" is displayed or even what exactly you mean by that. Is your application a web application, or a desktop application? Does the opened file appear in a "recently used files" menu and you want to hide it from there? Or is your question about something entirely different?

We can't give you any useful answers unless you explain in detail what you mean.
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is beyond the control of your application when launching the print via the Desktop class. I believe the Desktop class just executes the Print command for the application associated with this file type. What happens next is up to the application.

Some applications such as Word have command line switches that allow you to control their behaviour but you would then need to launch the application via Process so you would need to know the correct application to use for your file, the path to the application and what switches to add.
 
monicka rk akilan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai every one... thanks for your suggestion...
this is my code....
---------------------------------------------------------------------
------------------------------------------------
when i run this code the file is showing first and then printing...
i dont want to show the file....
Without showing the file. i want to print directly....
thanks in advance.

How to make this with out show file....

-Monicka Akilan
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags (← click) when posting code as it makes it easier for people to read your code. I've added them for you this time.

What application is opening to print the file, and is it closing after printing?

As I said in my previous post you can't control the visibility of the application. If your application isn't closing after it has printed and you are on a Windows machine you can print text files using Notepad by using java.lang.Process (created from java.lang.ProcessBuilder) ie:
This will open Notepad displaying the file, print it and then close notepad.
reply
    Bookmark Topic Watch Topic
  • New Topic