Expanding Screen horizontally


hai,

I want to expand my screen in horizontal direction ONLY. now when i click maximize button i shud expand in horizontally only not vertical....

can any body help me .....

Posted On: Tuesday 23rd of October 2012 11:31:28 PM Total Views:  268
View Complete with Replies

RELATED TOPICS OF Swing / AWT / SWT PROGRAMMING LANGUAGE




Dialog updates database - how to update other screens' combos/lists/tables?

Hi , I have a dialog that modifies records within my database. But when I go to a different screen where the combo box has data from that table displayed it isn't updated with the new record that has been added. If I close my program and restart it then the combo box appears updated but I can't imagine many users wanting to do this on a regular basis. Is someone able to tell me how I can update the combo boxes/lists/tables on other screens that use this data Many
VIEWS ON THIS POST

175

Posted on:

Wednesday 17th October 2012
View Replies!

JPopupMenu and full screen, Mac OS 10.4

, Ok, first off, I should probably ask if there's any good forums that anyone knows of that specific to Java development on Macs - there appear to be some, ah, shall we say, "interesting" quirks with Java on a Mac. That said, I'm having this particular issue. I have a class that extends JPanel. At one point, when the user performs a specific action, I want to show a JPopupMenu (it's actually a class that extends JPopupMenu, but not significantly so). Now, the user can choose to have the application running in normal mode, or in fullscreen mode. Fullscreen mode is done via: GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(myJFrame);
VIEWS ON THIS POST

125

Posted on:

Wednesday 17th October 2012
View Replies!

Printing the applet screen

i want to print the applet screen through the printer....Can anyone help me...I want to know,what should be to print the applet screenPlease help me,out...
VIEWS ON THIS POST

108

Posted on:

Wednesday 17th October 2012
View Replies!

splash screen

can any one tell how tocreate swing splash screeen \t
VIEWS ON THIS POST

77

Posted on:

Wednesday 17th October 2012
View Replies!

Get x,y coords outside of windows/screen using mouselook technique

When you move your mouse all the way to the left - it hits the left edge of the screen and stops - even if the user keeps moving his mouse to the left. In Java, there doesn't appear to be any way to detect that the user keeps moving his mouse "left". Basically, if the current mouse coords are 50,100 and I move my mouse 10 feet to the left on my desk Java will still only report the position as 0,100. My problem is, not only do I have to detect that the user moved the mouse to location -32535235,100 I also have to detect that position accurately. In order to accomplish this, I'm doing the following: 1) Use robot class to forcefully move the cursor to the center of the screen. 2) Detect relative mouse movements and some Point which keeps track of the total movement 3) Repeat - go back to step 1 The code I'm using is basically straight out of a Java game development book "Developing Games in Java". This technique appears to work well for reporting simple changes in the relative x,y movement. It does not appear to be accurate in reporting actual x,y coordinates. So my test case is this: 1) Start the application. 2) Move the mouse 1 foot to the left (left side of desk) - record the X location 3) Move the mouse 2 feet to the right (right side of desk)- record the X location. 4) Finally, move the mouse back to the left side of the desk and ensure it is the same (or very close) to the location recorded in step 2. Currently when I do this, it's way off by hundreds of pixels. Is there a simple error in the code that I'm missing Any ideas on how I can accomplish this Here's the code: import java.awt.BorderLayout; import java.awt.Point; import java.awt.Robot; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.JComponent; import javax.swing.SwingUtilities; public class SimpleRecenterTest extends JComponent implements MouseMotionListener { private Point location; // location relative to where the mouse cursor starts private Robot robot; // use robot to recenter cursor private Point centerLocation; // center of this component private Point lastActualLocation; // last actual x y coords private boolean isRecentering; public SimpleRecenterTest() { location = new Point(); centerLocation = new Point(); lastActualLocation = new Point(); try { robot = new java.awt.Robot(); } catch (java.awt.AWTException ex) { ex.printStackTrace(); } } public void mouseDragged(MouseEvent e) { mouseMoved(e); } public void mouseMoved(MouseEvent e) { // If the cursor reached the center, stop recentering... if (isRecentering && centerLocation.x == e.getX() && centerLocation.y == e.getY()) { isRecentering = false; } else { int dx = e.getX() - lastActualLocation.x; int dy = e.getY() - lastActualLocation.y; location.x += dx; location.y += dy; System.out.println("Location X,Y: " + location.x + "," + location.y); recenterMouse(); } lastActualLocation.x = e.getX(); lastActualLocation.y = e.getY(); } public void init() { centerLocation.x = getWidth() / 2; centerLocation.y = getHeight() / 2; recenterMouse(); addMouseMotionListener(this); } private synchronized void recenterMouse() { if (robot != null) { isRecentering = true; Point p = new Point(centerLocation); SwingUtilities.convertPointToScreen(p, this); robot.mouseMove(p.x, p.y); // robot moves cursor using scren coordinates } } // Test it public static void main(String[] args) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { SimpleRecenterTest srt = new SimpleRecenterTest(); javax.swing.JFrame f = new javax.swing.JFrame(); f.setLayout(new BorderLayout()); f.getContentPane().add(srt, BorderLayout.CENTER); f.setSize(800, 600); f.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); f.setVisible(true); srt.init(); } }); } }
VIEWS ON THIS POST

130

Posted on:

Wednesday 17th October 2012
View Replies!

Problem in screen capture

I have a Java Swing application which is started by a batch(.bat) file. The batch file is in turn started by a utility written in C++ as a seperate process using WIN32 API. In my java application I am getting screen captured using createScreenCapture() method of java.awt.Robot class. When I manually start the batch file, i am getting screen shots correctly. But if I use the utility written in C++ to start my application, i am getting a black rectangle instead of actual screen shot. Please let me know how to solve this issue Also let me know if there is any way to capture screen other than using java.awt.Robot class.
VIEWS ON THIS POST

85

Posted on:

Thursday 18th October 2012
View Replies!

how to resize image to screen size

hello, 1more problem I have an auto fit button on my JApplet, when i click on the JButton, I want the Image to be resized to the screen size. how to do this can anyone get me a solution for this
VIEWS ON THIS POST

115

Posted on:

Thursday 18th October 2012
View Replies!

how to prompt login frame in the middle of screen

, i have to prompt the login frame in the middle of the screen but by default the frame is displayed at the left top is there any code apllied to change plz give suggestion with regards ravi
VIEWS ON THIS POST

100

Posted on:

Thursday 18th October 2012
View Replies!

Screen meshing into main screen

[size=12]
VIEWS ON THIS POST

85

Posted on:

Sunday 21st October 2012
View Replies!

SWT Label position on screen

i was wondering how i can find out the x and y position of a label on the screen because i wan to put the cursor there. getBounds() and getLocation() seem to give me only the location within the composite the label is in, but i want to know its x and y location on the screen. Any ideas
VIEWS ON THIS POST

99

Posted on:

Monday 22nd October 2012
View Replies!

The sample screen I need in java using SWT

Hi , I am developing a desktop application using SWT. I am new to Java, i read swt forums. But unable to figure it out how to develop a java screen like below. I am attaching my 2 files as an attachment. Please find it below. I really appreciate your help.
VIEWS ON THIS POST

105

Posted on:

Monday 22nd October 2012
View Replies!

Getting a screenshot of a JPanel

I have a JTree in a JPanel and want to get a screenshot (bitmap image) of the contents of the JPanel. Any ideas how I do that Once I have the screenshot I plan to do some manipulation on the image. Cheers, Rupert
VIEWS ON THIS POST

96

Posted on:

Monday 22nd October 2012
View Replies!

getting paint notifications for offscreen components

Hi , I'm creating a scrollpane that displays it's view using OpenGL, for ultra-smooth scrolling. To do that, it paints a large area of it's view onto an image and displays the portion that it needs. When you scroll close to the edge it paints some more, asynchronously. The scrollpane's paint() method paints to an image, and there is a separate thread that renders this image to the screen using OpenGL. It is working beautifully, except for a few small problems. #1: If a component that is NOT in the visible area of the scrollpane calls repaint(), then the RepaintManager thinks it's invisible and doesn't call paint() in the scrollpane. I'd like paint() to be called for ALL child component repaints, then I can determine whether they are in the cached area or not. #2: If a component calls paintImmediately(), the scrollpane's paint does not get called. Is there an easy way to force paintImmediately to do this If not, no worries. #1 is the thing that's really bugging me though. Any ideas
VIEWS ON THIS POST

100

Posted on:

Monday 22nd October 2012
View Replies!

Capture screenshot of a widget without displaying it

. I want capture screenshot of a widget[SWT](for example, a button, a panel or a browser) without displaying it on the screen, and save the screenshot as a file. Does anyone have any ideas
VIEWS ON THIS POST

119

Posted on:

Monday 22nd October 2012
View Replies!

splash screen with a progress bar loading "Help me"

please help me, i am doing a project for the university but can't start. I am unable to load my progress bar in my splash form. none of my buttons are working. I badly need help. So please, do reply.
VIEWS ON THIS POST

155

Posted on:

Monday 22nd October 2012
View Replies!

JFrame not fitting to screen.

I want to make a jframe which is the top level window with a menu bar. It is going to be the first screen of my project. I want that when the program is executed the window is opened in complete screen. I have rummaged places for it but cant find how it can fit the complete screen when opened. Definitely setSize(int w,int h) dont help. Moreover, if you can tell, how the same effect can be obtained in netbeans. Kindly help.
VIEWS ON THIS POST

74

Posted on:

Monday 22nd October 2012
View Replies!

Maximising a frame to fullscreen on start-up?

, I've got a frame the is intended to be at fullscreen size - so who ever uses this program the frame is intended to maximise to meet the size of their screen. However I can't figure out how this is done Can anyone shed some light on the matter
VIEWS ON THIS POST

68

Posted on:

Monday 22nd October 2012
View Replies!

full-screen gray window problem and event handling problem

I want to show a fullscreen color and draw some lines. The program should work on Windows _and_ OS X. So I can not just set the window to the screen size. This will work on Windows, but not on OS X where the menu bar and dock will still be visible. I came up with the following little program which compiles fine, but shows a gray window shortly after the correct blue window is painted. Also the event handling will not work and I don't see an error. Pressing SPACE should exit the program, but doesn't. Looking forward any pointers. Here's the sample source: // ------- source full-screen begin -------------- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FullScreen implements KeyListener { public void keyTyped(KeyEvent event) {} public void keyPressed(KeyEvent event) {} public void keyReleased(KeyEvent event) { if (event.getKeyChar() == KeyEvent.VK_SPACE) { System.exit(0); } } public void go() { JWindow window = new JWindow(); window.setVisible(true); window.addKeyListener(this); window.setBackground(Color.BLUE); window.setForeground(Color.WHITE); GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().setFullScreenWindow(window); } public void paint (Graphics g) { g.setColor(Color.WHITE); g.drawString(", World!", 50, 50); g.drawLine(0, 1000, 500, 0); } public static void main(String[] args) { FullScreen f = new FullScreen(); f.go(); } } //-------- source end -------------
VIEWS ON THIS POST

91

Posted on:

Monday 22nd October 2012
View Replies!

What controls the where a jTree node is drawn on screen?

What controls the where a jTree node is drawn on screen I want to have some of the nodes indented an additional 20 pixels and am not sure what to override to accomplish that
VIEWS ON THIS POST

70

Posted on:

Tuesday 23rd October 2012
View Replies!

screen flickers

hi, i have a JTable in my application. JTable will have addition/deletion of rows. I am repainting the table for each updation. Suddenly, i am getting a ArrayIndexOutOfBoundException from getValueAt() with proper model. After this Exception, my application starts flickering in the screen. Please! help me asap. regards, stp.
VIEWS ON THIS POST

96

Posted on:

Tuesday 23rd October 2012
View Replies!