Following is my program i need to add scroll to jframe and I have paint method in it package other; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.ScrollPane; import java.awt.Stroke; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.geom.Line2D; import javax.swing.*; public class MainDrawCycle extends JPanel implements ActionListener { JButton button; JLabel label; JTextField textField; JScrollPane pane; JPanel panel; JFrame frame; Container c; static int val; int xa,ya,xb,yb,x1,y1; int xc,yc,xd,yd,xe,ye,xf,yf; int lsb=0,msb=7; char val1='A',val2='B'; // public MainDrawCycle(JFrame f) // { // pane=new //JScrollPane(f,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); // add(pane); // } public MainDrawCycle() { setLayout(null); //frame=new JFrame(); // panel=new JPanel(); // pane=new //JScrollPane(panel,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); …

Member Avatar
Member Avatar
+0 forum 21

i tried using this where ros and cols is an integer which is equals to 8 [CODE]if (i == ros || j == cols) { if (i == ros && j > cols) { cols++; } else if (i == ros && j < cols) { cols--; } else if (j == cols && i > ros) { ros++; } else if (j == cols && i < ros) { ros--; } int k = secret.nextInt(); Tile boardtile = playersarray[currentPlayer].gettile(k); b.add(i, j, boardtile); System.out.println(""); b.Print_Board(); System.out.println(""); playersarray[currentPlayer].add_Tile(boardtile); playersarray[currentPlayer].gettiles().remove(k);[/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hi, first time poster, and fairly new to java swing.Im trying to make a scrabble game and am stuck while trying to place a letter on the board, or even removing one for that matter. The playing board is just an array of JButtons all derived from a ScrabbleButton object, some are subclassed for double word scores or player tiles. The problem is, I cant place a tile on the board by overwriting one of the buttons in the array with a new ScrabbleButton object here is the code for the board being initialised [CODE]public void buildBoard() { layout= new …

Member Avatar
Member Avatar
+0 forum 12

The board game scrabble works by assigning points to wooden tiles arranged in cells on a board. It's described here:[url]http://en.wikipedia.org/wiki/Scrabble[/url]. We'll simplify this considerably, and consider the following question. We begin with the letter-scoring scheme from Scrabble: a = 1, b = 3, c = 3, d = 2, ..., z = 10. Given a text file - a novel for example, and a word size, say 7 characters, what is the highest-(or a highest-) scoring word in the the file of that word size? Your solution should include two files: A driver, which we provide below, and which you …

Member Avatar
Member Avatar
+0 forum 10

And that word is: S-U-N-K. Although not entirely without trace it must be said. Yeah, yeah. I know that you guys in North America had already lost Scrabulous after Hasbro had taken legal action to take down the popular Facebook application there. Now Mattel, which has the rights to Scrabble outside of North America, has achieved the same result for the rest of the world. It seems that Facebook has decided to jump overboard and abandon the Facebook application ship before a court in India could push them. Which is more than a little odd, as usually you might expect …

Member Avatar
+0 forum 0

The End.